steffen henriksen
steffen henriksen

Reputation: 79

eventListener flash

I am working with AS3.

I simply can't remember what eventListener to use if I want it to start my function up by it self (as in not a mouseevent.CLICK)

It is intended for a quick flash banner, that should just start up when ever a user enters the site where it is located.

Upvotes: 0

Views: 51

Answers (2)

abnvp
abnvp

Reputation: 1027

You can do loaderInfo.addEventListener(Event.COMPLETE, _YourFunctionToBeExecuted) if you want to do something when your swf file has been loaded completely

Or

You can do addEventListener(Event.ADDED_TO_STAGE, _YourFunctionToBeExecuted) if you want to run your code when the display object has been added to the stage

Upvotes: 1

neil manuell
neil manuell

Reputation: 225

You don't need to hook into an event for this. When the site is loaded, the swf will load and play. If the site is refreshed, then the swf will be reloaded (from cache) and be replayed So any code that instanciates your app will be executed.

Upvotes: 6

Related Questions