jeudi 2 mars 2017

AS3 class / static variable init timing

I have a pure AS3 project (no mxml).

When compile using flex SDK 4.6, a class (and its static variables) is inited at the very first time when it is referenced (when static member being used or class instance being created).

When compile using air SDK 24.0, many class (and its static variables) are inited right at application start, not right before they are referenced. Why? Is there any compile option or SWF meta tag to prevent this?

My static variables need some other data to init, those data are dynamic loaded at run time, not immediately available at application start. So, i do not want them to be inited so early.

Aucun commentaire:

Enregistrer un commentaire