Here is the code to call function using event listener:
var listListener:Object = new Object();
listListener.change = function() { changeImage(); }
thelist.addEventListener("change", listListen开发者_如何学Pythoner);
Is there a way to call the function simply when the frame is loaded using the same function as above?
Thanks agus
So long as you're calling this from within an instance of a Class that extends EventDispatcher (i.e. MovieClip, Sprite, etc.)...
Use this to dispatch an event of that type (i.e. "change").
dispatchEvent(new Event("change"));
精彩评论