Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Thread Tools Rate Thread Display Modes
Old 06-07-2010, 03:02 PM   #1
Registered User
Join Date: Apr 2010
Posts: 5
Default Flex won't display a child of a container movie clip

I have a Container Movie clip called frameContainer in wich I load new Frames( a symbol from flash), with this function:

ActionScript Code:
var i:Number=0;             frameContainer.x=48;             xPos=0;             do             {                 frames.push(new Frame());                 frameContainer.addChild(frames[i]);                 slideshow.push(false);                 frames[i].index=i;                 frames[i].f.width=frameWidth;                 frames[i].f.height=frameHeight;                 frames[i].x=xPos;                 frames[i].y=0;                 xPos+=frames[i].f.width+10;                 frames[i].f.addEventListener(MouseEvent.MOUSE_UP,fMouseClickOnFrame,false,0,tru e);                 i++;             }while(xPos<200)               frameNumber=i;             this.addChild(frameContainer);

The previous function works great.And I have a function called addNewFrame() which adds a new Frame at the end:

ActionScript Code:
private function addNewFrame():void         {             frames.push(new Frame());             frameContainer.addChild(frames[frameNumber]);             frames[frameNumber].f.width=frameWidth;             frames[frameNumber].f.height=frameHeight;             frames[frameNumber].x=xPos;             frames[frameNumber].index=frameNumber;             xPos+=frames[frameNumber].width+10;             frameNumber++;             frames[frameNumber-1].f.addEventListener(MouseEvent.CLICK,fMouseClickOnFrame,fa lse,0,true);         }

But, for some reason, the new frame can't be seen. When I type just

ActionScript Code:

(instead of frameContainer.addChild(frames[frameNumber]) )

it works great. Also I can access the new frame with the getChildAt method, the only, and biggest problem is that I can't see that new frame when I add it as a child of the frameContainer movie clip.

Can someone please help
royalrapier is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 11:37 AM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.