This is advice is not exclusive to the realm of ActionScript but to OO
in general. Unless carefully orchestrated, making method calls from
within the constructor can result in unexpected results. It becomes more
apparent when derived classes are instantiated and there is confusion
between expecting a derived class to be initialized but the base class
has not been fully initialized.
The other thing to note is that ActionScript does not have
deconstructors (with the exception of MovieClip.onUnload which I find
great). So when finishing an application, your objects must also know
how to 'finish' themselves and those objects that it created. If you put
great care into making a constructor method in each of your classes, you
should put some thought in a dispose() method which will be responsible
for cleaning up what it started (for example, remove the movieclips it
created dynamically).
-mL
http://knowledge.lapasa.net
[EMAIL PROTECTED] wrote:
Hello,
Recently had to re-jig the start-up sequence to an AS2 flash app - caused
lots of unexpected side-effects
Struck me that there must be an agreed OO way to start/finish an
application.
Does anyone have some useful advice on best practice for app start-up from
an AS2 perpective?
regards
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com