The Flex 2 Evant class is no longer dynamic, so you can't add your own
information to it any more.

 

You need to subclass Event to make your own custom event, to which you
can add your custom data.

 

This is pretty easy, and there is an example in the docs:

http://livedocs.macromedia.com/flex/2/docs/00001644.html

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of trk247
Sent: Friday, December 22, 2006 1:05 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Custom Event Variables

 

Using Flex 2.0 - I have a child MXML document that has a custom 
event like this:

child.MXML
<mx:Metadata>
[Event("selectionChanged")]
</mx:Metadata>

function someFunction() {
dispatchEvent(new Event("selectionChanged", {x:something.x, 
y:something.y});
}

Now I'm trying to get the values of x and y back into the 
main.MXML file. 

I did create a selectionChanged class and Overrided the inherited 
clone() method like explained here: 
http://livedocs.macromedia.com/flex/2/docs/00001644.html.
<http://livedocs.macromedia.com/flex/2/docs/00001644.html.>  

This would have been the old way:
<something selectionChanged="getRestaurantListByArea(event.x, 
event.y);"/> but in Flex 2.0, it gives an error.

Any help appreciated.

 

Reply via email to