Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: removeChild from different frame?!?!

  1. #1

    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!
    Attached Files Attached Files

  2. #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;
    addChild(myHolder);

    myHolder.addChild(mytext);

    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

    removeChild(myHolder);
    myHolder:Sprite = new sprite;
    addChild(myHolder);

    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.

  3. #3
    Shaedo,

    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!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012