• Advertisement
Sign in to follow this  
  • entries
    292
  • comments
    557
  • views
    153869

Nested MovieClips

Sign in to follow this  

64 views

One of the cool things about Flash is that you can nest MovieClips within one another, and each MovieClip behaves essentially like it's own subprogram, and runs its own code in response to events that it receives.

The downside is that when you put MovieClips inside of other MovieClips, timing issues come up. Your MovieClip gets the onLoad event, but this doesn't mean that all of the nested MovieClips are loaded, and I have found that they never are.

So, what I do is have the leaf MovieClips (the ones with no children MovieClips) tell their parent when they have loaded. The parent then determines when all of its children have loaded, and when they have, it notifies its own parent, and so on down the chain, until the main object knows that everything has been loaded, and that it is safe to use all MovieClips.

It sort of has the same feeling as multi-threaded code, but only for loading MovieClips. The rest of the time, I can use the objects normally.

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement