Skip to main content
Known Participant
September 17, 2010
Answered

Bring movieclip to front

  • September 17, 2010
  • 1 reply
  • 1346 views

Hi

I have created a image gallery. There's a image scroller, when clicking an image it show large image on the same layer. I insert the image to this layer like this: addImage("image url", x, y, this). addImage is my own function witch works fine. In the begin of code I create movieclip (var controls:MovieClip;). When I'm inserting images to that, I want to bring the movieclip to front. Because that large image is added after the controls, it will be on the top.

How can I bring that movieclip on the top?

This topic has been closed for replies.
Correct answer

var controls:MovieClip=new MovieClip();

addChild(controls);  

1 reply

Inspiring
September 17, 2010

addChild(controls);

Known Participant
September 17, 2010

Error: "TypeError: Error #2007: Parameter child must be non-null."

First of all I create the movieclip:

var controls:MovieClip;

Then I run that addChild:

addChild(controls);    <- Error

Then I insert the images.

Inspiring
September 17, 2010

This is because you did not instantiate control variable but only declared it.