You can use com.dynamicflash.utils.Delegate instead of mx.utils.Delegate
and pass the myNewMc clip as an argument to onMenuRelease. person13's
Proxy class can also be used similarly.
-mark hawley
Jeff Jonez wrote:
I'm wondering if, when I use the Delegate class to set the scope of an
event handler, is it possible to reference the previous scope? My
problem is this...
I have a class which implements a menu. Each menu item is a movieclip
and I add new menu items by calling a function called addChild like
this.
var myMenu: new Menu();
myMenu.addChild( "Item1" );
myMenu.addChild( "Item2" );
In class Menu, the function addChild does something like this,
funciton addChild( txt:String ):Void
{
// make new mc, with a text field and set the txt
myNewMc.onRelease = Delegate( this, onMenuRelease );
{
function onMenuRelease( ):Void
{
// here I want to access class variable No problem!
// now I want to change properties of myNewMc! How do I access it?
// If I have 12 menu items, how can I know which one was triggered
the onRelease!?
}
So, when I get to the onRelease event handler, is there a way to
reference the scope of the MC that the event hander is attached to?
Or, because I used Delegate has the mc scope been lost and I need to
somehow keep track of that by, perhaps setting a focus variable or
something...
Makes sense?
Thanks.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com