Hi guys. Firstly, I am ashamed to say I never learned the event model/delegate crap in AS2. I tried once and just never followed through. I am proud to say I do know the AS3 event model very well.
SOOOO. I have this AS3 game that I made. Now the client wants me to refactor to AS2. I said, “F$&#, now I gotta learn the AS2 event model, well s&*^”. Anyway I am wondering if I could get the equivalents of the following AS3 event pieces:
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#808080]*//in AS3
//in some class
*[/COLOR] someEventDispatcherSomewhereElse.[COLOR=#000080]addEventListener[/COLOR][COLOR=#000000]([/COLOR][COLOR=Red]“someEvent”[/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#000080]onSomeEvent[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]//in another class somewhereElse[/COLOR]
[COLOR=#0000ff]this[/COLOR].[COLOR=#000080]dispatchEvent[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000]new[/COLOR] EventCOLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];
[/LEFT]
[/FONT]
So how easy is it to convert back to AS2? I think I have to use a Delegate class right?
I know, i know. Shame on me!