Вопрос

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?

Это было полезно?

Решение

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/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top