views:

531

answers:

1
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Label id="lb" text="check" click="init1()"/>
    <mx:Script>
     <![CDATA[
      public function init1():void
      {
       lb.text = this.width.toString().concat("-").concat.(this.height.toString());
      }
     ]]>
    </mx:Script>
</mx:WindowedApplication>

For the above Flex Code, when I click on the label lb, I get the following message at the runtime :

TypeError: Error #1123: Filter operator not supported on type builtin.as$0.MethodClosure.
at deleteIt/init1()[C:\Users\Dharmendra\Documents\Flex Builder 3\The_Vakeel\src\deleteIt.mxml:8]
at deleteIt/__lb_click()[C:\Users\Dharmendra\Documents\Flex Builder 3\The_Vakeel\src\deleteIt.mxml:3]

Could someone help me with this?

+1  A: 

You have a typo in your code, an extra "." before the second concat. Fixed:

lb.text = this.width.toString().concat("-").concat(this.height.toString());
Stiggler
good eye. lb.text = this.width.toString + "-" + this.height.toString() would be much clearer though.
CookieOfFortune
Sure is. dta is probably transitioning from a different language.
Stiggler
but the compiler should have given an error here. will have to file a bug report at adboe.
dta
filed a bug here : http://bugs.adobe.com/jira/browse/ASC-3750
dta