Components not displaying??…Dynamically load

by admin on August 7, 2007

otherwise you might be in trouble *snickers*. Avoid using movie clip instances on the stage and adding components nested within them. Try to instead dynamically load the external .swf through a mouse event or loadClip or movieCliploader.class

Example 1: The first don’t. Stay away from nesting your components
unless you have predetermined properties and methods
in your parameters.

Screenshot:  Nesting copmonents in MovieClips

Example 2: You can keep a background of some color, tone or shape on the bottom most
layer. Add an actions layer above it, and lock your layer.

external2.jpg

Example 3: Now add this bit of code to your movie clip. Make sure you get the depth at
at -1 correct otherwise it won’t load properly.

external3.jpg

this.createEmptyMovieClip(”empty_mc”, -1);
Note that you can only have 1 visual object at a certain depth. As soon as you try to load
another visual object into a depth that already has a visual object at that depth, the second
movieclip will load, but the first one will disappear.

This is a great piece of advice for anyone who is trying to load dynamic content, especially content with xml. You can build a very complex site using dynamically loaded content with php or xml.

“The real problem is just knowing how Flash handles things.
Once that is understood,everything else is pretty much trivial.”
- www.senocular.com

 

Leave a Comment