Classes/Components
Events
Delegate
So instead of having:
some_btn.onRollOver = function(){}
do this:
import mx.utils.Delegate;
myCustomButton.addEventListener("rollover", Delegate.create(this,
rolloverHandler);
Where myCustomButton is a custom component dispatching an event (in this case
rollover).
And in the event handler you can reference the component that dispatched the
event through the argument passed to the event handler
function rolloverHandler(o:Object):Void {
trace("target: " + o.target);
}
regards,
Muzak
----- Original Message -----
From: "Bob Wohl" <[EMAIL PROTECTED]>
To: "Flash Coders List" <[email protected]>
Sent: Friday, January 25, 2008 6:23 PM
Subject: Re: [Flashcoders] nested for loops stumper
so then would it be this._parent["mc_"+i] ?
enlighten please.
On Jan 25, 2008 9:08 AM, Muzak <[EMAIL PROTECTED]> wrote:
You should never have to do that.
If for some reason you have to, something is wrong with your workflow.
"this" is and should always be "this".
----- Original Message -----
From: "Rob Emenecker" <[EMAIL PROTECTED]>
To: "'Flash Coders List'" <[email protected]>
Sent: Friday, January 25, 2008 3:53 PM
Subject: RE: [Flashcoders] nested for loops stumper
>
>> yep, you need some kind of scope declaration to tell you where the
>> items are. a lot of people use thisRoot = this; (or something that
>> states the location) and then all you have to do is pass 'thisRoot'
>> around as a reference to where that item is. That way you never
>> have to say 'this' when it's not actualy 'this'.
>
> Thumps himself in the head! Doh! What a great idea. Never thought of
doing
> that!
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders