Jump to content

all about addChild?


pranadevil
 Share

Recommended Posts

To test this: Create a Sprite element and add another as it's child. Then call .kill() on the Sprite parent and you'll find the result. Asking questions is good, but experimenting is always the best way to learn, because you'll remember it long.

And Yes, the child element is also killed. Just tested it ;)

Link to comment
Share on other sites

6 hours ago, Umz said:

To test this: Create a Sprite element and add another as it's child. Then call .kill() on the Sprite parent and you'll find the result. Asking questions is good, but experimenting is always the best way to learn, because you'll remember it long.

And Yes, the child element is also killed. Just tested it ;)

thanks maybe you r right!

tried but didnt work. i created a bitmapdata and added as a child to a sprite. when called .kill() the bitmapdata remains alive.

any suggestion?

Link to comment
Share on other sites

20 hours ago, pranadevil said:

thanks maybe you r right!

tried but didnt work. i created a bitmapdata and added as a child to a sprite. when called .kill() the bitmapdata remains alive.

any suggestion?

If you add "true" to a destroy or kill function, it will also get rid of the childs. For example: object.destroy(true)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...