views:

18

answers:

1

I want to add a new Stage called field to the default stage (i need to place different elements on it later). And then i want to add a bitmap called myBitmap to the field. But nothing happens. I don't understand what should i do...

            var field:Stage = new Stage();
            field.x = 200;
            field.y = 200;
            field.width = 300;
            field.height = 300;
            stage.addChild(field);


            var bdWidth:Number = 100;
            var bdHeight:Number = 100;
            var bdTransparent:Boolean = true;
            var bdFillColorARGB:uint = 0xFF007090;
            var myBitmapData:BitmapData = new BitmapData(bdWidth, bdHeight, bdTransparent, bdFillColorARGB);
            var myBitmap:Bitmap = new Bitmap(myBitmapData);
            myBitmap.x = 10;
            myBitmap.y = 10;
            field.addChild(myBitmap);
+1  A: 

You cannot have multiple stages in an SWF. Use a Sprite instead.

The unique Stage object in an SWF is created automatically by Flash player. Even if you load another SWF into the first SWF and access stage from the newly loaded SWF or its children, you will still get the same stage object.

Amarghosh
Really?) Thanks.
Raigomaru