----- Original Message ----- 
From: "Johan Nyberg" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, June 11, 2007 11:27 AM
Subject: [Flashcoders] Scripting for objects that appear later on thetimeline


> Hi, how do you script for things that appear later on the timeline? I program 
> in AS2 and I've started to place all my scripts in a 
> Main.as file. But there is a limitation, I can't program for mc:s that have 
> not yet appeared on the _root timeline. I still have 
> to revert to placing scripts in a layer on the _root timeline on the 
> appropriate frame. Anyone have a solution?
>
> I've found my own technique when I use the Main.as file: I place an empty 
> movieclip on _root level that has Main.as linked to it. 
> Then in the constructor I use with(_root){} which I find convenient. Thoughts 
> on this? Is there a better solution?
>

Yes there is.. Don't use _root. Use your Main class/MovieClip as a replacer for 
_root.
So rather than placing/attaching everything to the root timeline, place it 
in/attach it to the Main MovieClip.

Here's what it looks like in an ARP type application:
http://muzakdeezign.com/arp/arp_application.jpg

Look into MVC/MVP and other Design Patterns for how to structure a Flash 
application and forget about the timeline and jumping from 
keyframe to keyframe.

regards,
Muzak 


_______________________________________________
[email protected]
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

Reply via email to