Skip to main content
Known Participant
May 9, 2013
Answered

Movieclip depth problem

  • May 9, 2013
  • 1 reply
  • 545 views

loc1-loc12 is movieclips on the stage, and they seem to be always on top. Even after  this.setChildIndex(MovieClip(e.currentTarget), (this.numChildren - 1)) I don't get it why....

public function mousedown(e:MouseEvent)

                    {

                              if (loc==false)

                              {

                                        targetarray.push(loc1,loc2,loc3,loc4,loc5,loc6,loc7,loc8,loc9,loc10,loc11,loc12);

                                        loc = true;

                              }

                              e.currentTarget.startDrag();

                              this.setChildIndex(MovieClip(e.currentTarget), (this.numChildren - 1))

 

                    }

This topic has been closed for replies.
Correct answer Ned Murphy

Indexes/depths are managed from lowest to highest, where the higher index object appears over other objects at lower indexes.  The line of code you are questioning is placing the object at the hioghest index.... this.numChildren-1.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
May 9, 2013

Indexes/depths are managed from lowest to highest, where the higher index object appears over other objects at lower indexes.  The line of code you are questioning is placing the object at the hioghest index.... this.numChildren-1.

as3pandaAuthor
Known Participant
May 9, 2013

Yes, I understand that, I have other movieclip on stage which I will be clicking. Not the ones from array. But the movieclip in the array above seem to be always on top

as3pandaAuthor
Known Participant
May 9, 2013

fixed