Hi,

Is it possible to have multiple view of the same display object?

The sample code follows:

        var content: Sprite = new Sprite();
        var v1: Sprite = new Sprite();
        var v2: Sprite = new Sprite();

            with(content.graphics) {
                lineStyle(2, 0xff0000);
                drawCircle(100, 100, 80);

                lineStyle(5, 0x009999);
                drawRect(50, 80, 200, 30);
            }


            v1.addChild(content);
            v1.x = 0;
            v1.y = 0;
            v1.scrollRect = new Rectangle(0, 0, 100, 100);
            addChild(v1);

            v2.addChild(content);
            v2.x = 100;
            v2.y = 0;
            v2.scrollRect = new Rectangle(0, 0, 100, 100);
            addChild(v2);


I thought this will make two viewports (v1 and v2) of the same object
(content).
But when I checked the docs, DisplayObjectContaner/addChild method, it says,

"If you add a child object that already has a different display object
container as a parent, the object is removed from the child list of the
other display object container."

Is there a solution for this?

Reply via email to