Flash levels

any advice on use?

Page 1 of 1

3 Replies - 22412 Views - Last Post: 20 October 2005 - 09:54 AM

#1 jkranig  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 20-July 05

Flash levels

Posted 19 October 2005 - 11:56 AM

Hello.
I've been teaching myself Flash over the last couple of months. Now don't laugh, but I just discovered the use of levels within the flash file. It seems like a great tool and I'm looking forward to using it.

Do you guys have a tips, techniques, advantages or disadvantages you may have come upon when using levels within flash?

Thanks. :D

Is This A Good Question/Topic? 0
  • +

Replies To: Flash levels

#2 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Flash levels

Posted 19 October 2005 - 12:48 PM

Levels are great... if you need them and understand how to use them. Let me stress that out.. IF you need them.

First of all, some people believe that levels and depth are different things. I don't agree or disagree with that. However, I have yet to find anything that might "seperate" the two. To me levels = depth and that theory has worked fine so far.

You should onlyworry about depth/levels when getting into scripting. Animations using just layers don't need the concept of depth to be known.

Most common use for depth is when creating or duplicating movieclips using actionscript. When doing so, the new clip has to be placed in the level heirarchy. If the order of the clip's depth is irrelevant and you just need the clip just use the next highest depth, like so:
createEmptyMovieClip("mc", this.getNextHighestDepth());


..or you can give it a numeric value. However, if you give it a numeric value that has already been used, the new movieclip will replace the previous movieclip with that depth.

Example:
duplicateMovieClip("mc", "mc2", 6);
duplicateMovieClip("mc", "mc3", 7);
duplicateMovieClip("mc", "mc4", 6);


... the new movieclip "mc4" which is created in level 6, will replace the previous "mc2" also on level 6... "mc2" will disappear off the stage.

if need be, you can easly switch depths between movieclips using swapDepths();... like so:
//mc1 is on level 4 and mc2 is on level 200
mc1.swapDepths(200);


"mc1" will go to level 200 and whatever is on level 200 goes to the previous level of "mc1".

[edit:add]
You don't need to know the exact depth of a movieclip, either. Which helps when you have lot's of elements on stage. Instead of providing the swapDepths() function with a numeric value, you can give the name of a movieclip you wish to swap with:
mc2.swapDepths(mc1);


If you just want to bring a movieClip to the front, combine swapDepths() with nextHighestDepth():
mc.swapDepths(this.getNextHighestDepth());

[/edit]

Level 0 is _root, the top most level. The stage.

Basically, levels are used to keep order of what's what above or below what... like layers.
Was This Post Helpful? 1

#3 jkranig  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 28
  • Joined: 20-July 05

Re: Flash levels

Posted 20 October 2005 - 06:46 AM

Quote

You should only worry about depth/levels when getting into scripting.

Can you expand on this for me? or did you already when you explained different ways of uploading/swapping movieclips with actionscript?
Was This Post Helpful? 0
  • +
  • -

#4 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Flash levels

Posted 20 October 2005 - 09:54 AM

If you intend to use a lot of script, creating, duplicating and things like that, then it's probably better to get used to levels. However, if you're doing straight forward animations or using simple script for buttons and such, then don't owrry about levels.

The main use is in actionscript to manage the different elements... their heirarchy on screen.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1