|
-
addChild moves textbox above other images/movie clips
I have a dynamic text box inside a movie clip. The movie clip resides below a bunch of other images and movie clips on the stage, so that if the other movie clips are moved across the screen, they cover up the text box.
The problem I have is that I added a link dynamically, and now the textbox appears on top of everything else. Is there a way I can make this sit behind everything else again?
My code:
public function showContent():void {
this.gotoAndStop( "content" );
// hide various screens
hideClip( this.startmenu );
hideClip( this.downloadscreens );
showClip( this.bodytext );
setClipLanguage( this.bodytext );
this.bodytext.introCopy.htmlText += "Disc 1 is totally baller. Some other text. Etc, etc, etc. Please review the the <a href='event:Link Clicked'>usage guidelines (PDF) </a> before beginning work.";
addChild(this.bodytext.introCopy);
this.bodytext.introCopy.addEventListener(TextEvent .LINK, linkEvent);
this.bodytext.language.addEventListener( MouseEvent.CLICK, this.selectLanguage );
}
function linkEvent(event:TextEvent):void {
trace("HOORAY! I'm a PIRATE");
// Link Clicked
}
I tried to add this code:
Stage.setChildIndex(this.bodytext.introCopy, 0);
but I got an error, Stage is not a variable
-
Stage is a class. stage is an instance.
You've got to call setChildIndex on the parent of the child, so if you added it to anything other than stage (like root), that line is incorrect.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|