Skip to main content
Known Participant
May 5, 2006
Question

How to define a layer

  • May 5, 2006
  • 1 reply
  • 213 views
say i have created a movieclip

_root.createEmptyMovieClip("myLine",0);

how do i define what layer it starts on?

because im making a paint, and i want a fast and easy way to make it below the paint color panel layer.
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
May 5, 2006
you can control its depth. you used zero in your code.

you cannot control layers with actionscript. objects created in the authoring environment are assigned a depth by flash and you can control (to some extent) the depths it assigns by placing objects on different layers in the authoring environment.

if you want to see what depth flash has assigned for a movieclip created in the authoring environment, use the movieclip getDepth() method. if you want to see approximately what depth flash has assigned for a non-movieclip object, sandwich the object between two movieclips and check the depth of the two movieclips.