jeudi 11 juin 2009

The timeline is still your best friend

Referring to the previous post, a flash application that needs to be initialized at the beginning, and furthermore which must be called by javascript at the beginning, there is at least one guaranteed way to know when a flash movie is ready: the timeline. Once the scripts in the timeline are being executed, we know for sure the flash application is ready to be used by javascript or to manipulate lists. This means, supposing your flash app has a class document, you have to create an initializing function (e.g. init()) that is called in the very first frame of the timeline (but which must be called only one time. This must be taken care of). And if javascript is involved, the init() can do an ExternalInterface.call to tell to javascript the flash file is ready.

Aucun commentaire:

Enregistrer un commentaire