Copy link to clipboard
Copied
it's not possible to reparent a symbol created with drawing tools and added from the library or created on-stage (draw whatever > convert to symbol) unless it's removed (and that's not doable via removeChild) first from the stage. ie,
this.box.addChild(this.circle);
/* won't work with on-stage instances of this.box and this.circle without prior removal of this.circle*/
Probably because of stage's life cycle.
Something like this should work.
stage.on("drawend", function(){ this.box.addChild(this.yourContainer.circle); }, this, true);
What does happen if you call stop on this.box2 first?
Copy link to clipboard
Copied
Hi, k.
You need to call this.stop() even if the timeline has only one frame - because it seems it continues playing - for display list's methods to work properly.
Regards,
JC
Copy link to clipboard
Copied
ohhh, that sounds promising. testing.
Copy link to clipboard
Copied
that was it. thank you, thank you, thank you, thank you.
Copy link to clipboard
Copied
i spoke too soon. it worked in the case of main timeline object added to another object.
but failed silently when trying to reparent a non-main timeline object.
Copy link to clipboard
Copied
Probably because of stage's life cycle.
Something like this should work.
stage.on("drawend", function(){ this.box.addChild(this.yourContainer.circle); }, this, true);
Copy link to clipboard
Copied
the event fires but, that fails to reparent, too.
Copy link to clipboard
Copied
Make sure you're also stopping the target's instance timeline.
Copy link to clipboard
Copied
still doing that:
Copy link to clipboard
Copied
What does happen if you call stop on this.box2 first?
Copy link to clipboard
Copied
ooh, excited to test stopping all.
Copy link to clipboard
Copied
ok, you got it. there are two things i was missing:
1. the object to be reparented: its parent timeline must be stopped before it can be reparented
2. the event "drawend" (or some other delay) must be implemented.
the reparenting is momentarily visible unless stage.update() is executed after the addChild code.
Copy link to clipboard
Copied
If you enable the _off property it will remove a child from the list of managed children. If animated you will also need to remove any tweens that target it from the timeline if such tween sets a state or _off property.