0
votes

I think there are 2 different practices with dealing with display object on the stage.

  1. You draw all the objects on the stage and then manipulate the "visible" attribute to show or hide them.

  2. You use addChild and removeChild to manipulate the visiblity

How do you think what is the best method for this?

Chris

3

3 Answers

2
votes

I think the visible property should be used, you don't have to keep track of the display object visibility, unlike removeChild, which will throw and exception if you call it in a DisplayObjectContainer that does not contain a child.

0
votes

You use addChild and removeChild to manipulate the visiblity.

It has some advantages comparing with timeline movieClip

   1. Effective drawing,    

   2. flexibility in handling,

   3. Increased performance and 

   3. granularity of its application programming interface (API)
0
votes

I think it chages under conditions, if you won't use movieClip again you can use removeChild, and as i know visibility change dont stop its timeline. If you dont need to track for childIndexs you can remove from stage.