This content has been marked as final.
Show 6 replies
-
1. Re: ActionScript Guru needed
Rothrock Jun 10, 2008 11:03 AM (in response to ooba)Not sure I follow exactly, but in AS2 event handlers usually change the scope away from the class instance to their own instance.
I think you need to use the Delegate class to keep the scope within your class.
someInstance.addEventListener("event",Delegate.create(this,callbackFunction);
Don't forget to import mx.utils.Delegate -
2. Re: ActionScript Guru needed
ooba Jun 10, 2008 11:18 AM (in response to ooba)The reading on this is assigning to a specific function for a specific event.
But, what about when using
_MCLiListener = new Object();
_MCLiListener.onLoadStart = function(...
_MCLiListener.onLoadInit = function(... etc.
_MCLi = new MovieClipLoader();
_MCLi.addListener( _MCLiListener, Delegate.create(this,_MCLiListener) );
How exactly would i write that to it? -
3. Re: ActionScript Guru needed
kglad Jun 10, 2008 11:19 AM (in response to ooba)or you may be making your variables local the functions where they are typed using the var prefix. -
4. Re: ActionScript Guru needed
ooba Jun 10, 2008 11:21 AM (in response to ooba)the vars are definitely not local to the function. They are accesible from within all the functions of the Class just not the event handlers -
5. Re: ActionScript Guru needed
Rothrock Jun 10, 2008 12:56 PM (in response to ooba)I would try:
_MCLi.addListener(Delegate.create(this,_MCLiListener));
I thought you were using the other kind of event listeners. I've never tried this, but it seems like it should work? Let us know. -
6. Re: ActionScript Guru needed
ooba Jun 10, 2008 1:02 PM (in response to ooba)hmm. well right now i've done the following which is partially working. The variables that i was not able to get at I can now get at. The only remaining problem is that the getBytesTotal is never found or defined something odd.?