Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find out what level a Mc is on? How? Help! 1

Status
Not open for further replies.

TulsaJeff

Programmer
Jan 29, 2001
870
US
This may be a silly question, but, I have no idea how to specify or find out what level a movie clip is on. I hear people saying level100 and level44...

I know the main timeline is level0 but other than that I am stumped.

Can someone bring me out of the dark on this?#-)

thanks!

By the way...I always cast a vote for anyone who even attempts to help me.:cool:
 
For what it's worth!... And maybe a star!

My understanding of the use of levels is that it's like layers. You're just stacking up one movie over the other... unless you load it on level 0, where it then replaces your current movie.

So then, when loading a movie on level 5, if it has a opaque background, it hides the movie which is on level 0.
Removing the movie on level 5 (with unloadMovie) will let level 0 visible again.

When you use the loadMovie action is the only time you should have to worry about levels. You determine on which level you want to load or unload a movie.

B-) "If nothing else, I can always serve as a bad example!”

 
It's important to understand the difference between movieclips and movies when dealing with levels.

Just to back up Old's comments:

loadMovie() is when you're going to use levels most often -
loadMove("newMovie.swf",_level1);

..and the like but it's important to remember that, although this works if _level1 exists (if you already have something loaded there) it may load itself into _level0 otherwise (_level1 reads as "undefined"). Doesn't always happen in my experience but has caught me out before. The safest thing to do is...

loadMove("newMovie.swf","_level1");

The quotes make all the difference.

You can also reference levels when using unloadMovie(), loadVariables() and print().

If you need to target a movieClip within a movie on another level something like this works...

_level2.myClip.stop();

If you want to shuffle the stacking order of movieClips within a level use swapDepths().

this.swapDepths(1000);//which places this clip at "depth" 1000 (ie it appears on top of any clip at depths below 1000)

or

myClip.swapDepths(myOtherClip);//myClip and myOtherClip clip swap stacking positions
 
Couldn't swapDepths be used directly on levels?

Regards,
wink4.gif
ldnewbie
 
Doesn't look like it - swapDepths() a method of the MovieClip Object.

Flash movies are built up from multiple stacks of MovieClips and of course you can stack movies themselves in the final document but where you load the movie is where it stays unless you purposefully load or unload it.

However you can use swapDepths() on the clips within any of the movies themselves.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top