A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: removeChild

  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    166

    removeChild

    Ok here is my question:

    I have a Main.as tied to the root stage.
    Inside the Main.as I create a MC called subClass.as
    Inside that subClass movieclip I have another movieClip called subsubClass.as by going this.addChild(subsubClass).

    now how do I remove subsubclass?
    Last edited by shamimsaad03; 01-07-2010 at 11:55 AM.

  2. #2
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    from your main.as file, use your reference to the subclass as file, and then use remove child subsubclass.

    Make the subsubclass public though.

  3. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    166
    so like main.subclass.removechild(subsubClass)?

  4. #4
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Essentially speaking yes, but I'd have to see your source code to tell you for sure. If you want to attach a source file here, I'd be happy to take a look for you.

  5. #5
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    you'd also have to give proper class reference to that child in the removeChild statement as well.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center