itsmequinn
itsmequinn

Reputation: 1084

Can two Stages contain the same child element?

Is is possible for two stage objects to contain the same child element?

I am basically looking to create two stages with differing scale factors, each containing all of the same child elements and essentially "mirroring" each other at different scales. Whenever I add a child element to the second stage, it seems to be removed from the first automatically. Is there an option I'm not aware of to allow multiple stages to share and render the same child objects?

Upvotes: 0

Views: 346

Answers (1)

egaudette
egaudette

Reputation: 98

They can't contain the same children, as you've seen by adding children from one stage to the other.

You may want to clone the main stage and recreate it within the second, or at least the children of the stage.

child = stage.getChildAt(i).clone(true);

See this simple example: http://jsfiddle.net/jAUEv/1/

Upvotes: 1

Related Questions