That should generate a compile error since there is no .width property
on foo (because it is an int).

 

I'm guessing you really wanted:

 

private function clickHandler(event:MouseEvent,arg1):void
{
trace(event.target);
DisplayObject(event.target).width = DisplayObject(event.target).width *
arg1;

}



 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Jason The Saj
Sent: Wednesday, April 16, 2008 11:58 AM
To: [email protected]
Subject: [flexcoders] Well, that does me absolutely no good....unless
you can show me how to do this!

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> ">

<mx:Script>
<![CDATA[

private var foo:int = 7;

private function clickHandler(event:MouseEvent,arg1):void
{
trace(foo);
foo.width = foo.width * arg1;

}

]]>
</mx:Script>

<mx:Button id="btn1" click="clickHandler(event,1)"/>

<mx:Button id="btn2" click="clickHandler(event,2)"/>

<mx:Button id="btn3" click="clickHandler(event,3)"/>

 

Reply via email to