开发者

how to call function on movie load in actionscript instead using event listener?

开发者 https://www.devze.com 2023-03-19 16:04 出处:网络
Here is the code to call function using event listener: var listListener:Object = new Object(); listListener.change = function() { changeImage(); }

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"));
0

精彩评论

暂无评论...
验证码 换一张
取 消