I'm essentially re-packaging the MovieClipLoader class using composition. Each instance requires a reference to a listener object. When I create two instances of the class and reference a separate listener object for each, the second one occurring in script is being used by both instances. Rearranging the code proves that it's the last object occurring in my script that is the only one being used.
I may not be forwarding the event functions correctly but it works just fine when using only one instance of my preloader class.
Here is a snippet from the class:
and the usage:Code:public function get onLoadProgress():Function{ return mcl_L.onLoadProgress; } public function set onLoadProgress(func:Function){ mcl_L.onLoadProgress = func; }
Like I said it works just fine for one instance. Would using inheritance solve this?Code:myPreloaderInstance.onLoadProgress = function(target, bytesLoaded, bytesTotal){ //update code }




Reply With Quote