Results 1 to 3 of 3
April 11th, 2009, 10:55 PM #17Registered User
removeChild from different frame?!?!
hello again friends... happy easter!
I am having a rough time dealing with this problem:
I have a set of buttons on the main timeline that gotoandplays movieclips that reside in different frames.
These movieclips are on the stage by using addChild statements.
As I click a button and it takes me to that specific frame, I am having hard time removing these movieclips using conditionals when I click on one of the buttons...
I know it is hard to explain, but it probably is a simple problem a noob like me can't solve...
I tried to replicate my problem in the attached source file... so it may be easier for someone to understand my specific question.
*Again, I have to use addChild statements for these movieclips on each frame... I know this would be no issue if it were just timeline object based...
Please help! It would be greatly appreciated... and happy easter!
April 12th, 2009, 03:35 AM #2
Normally you would just link the creation/change of your text to either a event (eg a mouse click event) or a frame change and not both.
If you want to have both
a)frame change and
b)change a dynamic peice of text;
then I reccomend you think of them as two seperate things.
Dont mesh them together like in your example.
That said you could do what you have done if you place your dynamic text mcs into a holder:
eg myHolder:Sprite = new sprite;
Then when you want to remove it you can either
myHolder.removeChildAt(0) // add this before adding more children to the holder
or re-create myHolder
myHolder:Sprite = new sprite;
It is really hard to tell what you are trying to do because, to make it appear to work, all you have to do is strip the code out of your frames and it appears to work fine.
If you are as you say a 'noob' then I reccomend using traditional standard practices rather than making up exotic ways of doing things. As such I highly reccomend just looking at some basic turorials on AS3. That said I applaud your adventurous spirit! Best of luck.
April 12th, 2009, 05:18 PM #37Registered User
Hello, Thanks for your reply!
Man, I had so many things actions going on inside my actual fla file that I guess looking back, I made this thing more complicated than I had to.... so that must definitely define myself as a noob.
But all things are fixed... just by simplifying things. thanks for taking your time to answer!
Have a great day!