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

 Share

  • Recently Browsing   0 members

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