actionscript 3 - AS3 Having difficulty getting movieclips to stay on top over other clips -


So I have 5 movie clips on the screen when clicked (bottom position) extension they are all due to this code screen Come to the top of:

  addChildAt (this.Step0btn, 1); AddChildAt (this.Step1btn, 1); AddChildAt (this.Step2btn, 1); AddChildAt (this.Step3btn, 1); AddChildAt (this.Step4btn, 1);  

My point is that another movieclip also extends on each of the extension movieclips, but when I click that it still displays everything below. I guess I just like another addChildAt order can add thought:

  addChildAt (this.Step0btn.Step0img, 1);  

But when I do this, I get this error:

Type error: # 2007 Error: The parameter child should be non-empty on flash.display: : DisplayObjectContainer / addChildAt () on SMARTTTraining_fla :: MainTimeline / SMARTTTraining_fla :: frame5 () [SMARTTTraining_fla.MainTimeline :: frame5: 14]

and then extend movieclip is still displayed at the bottom of everything. What could be wrong here?

Step0img to null when the code The possibility to run the row might be explaination that Step0img is on the frame that is not present on Step0Btn .

I assume that your layering issue (and its error), it will be what you want to do:

  this.addChild (Step0btn);  

or

  this.setChildIndex (step 0btn, this.numChildren-1);  

They do the same thing it will bring the most important layer on top of another phase button, you addChild (step0btn.step0img) and do not want to change the parent / child relationship Are;

If you have the same code that I provided in my other, this is what onPress method will look like now:

< pre> function onPress (event: MouseEvent): void toggle between {/ / button to button 1 and 3 and the step (phase 0 btn.currentFrame == 3? 1: 3); // This is likely to spread parent.addChild (this) to your button; // This (this button) moves to the foreground}

Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -