<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="init();" >
<mx:VBox width="100%" height="100%" id="vbox">
<mx:UIComponent width="100%" height="100%" id="uiComponent">
</mx:UIComponent>
</mx:VBox>
<mx:Script>
<![CDATA[
import mx.controls.Image;
private function init():void{
var s:Sprite = new Sprite();
s.graphics.lineStyle(2, 0xff0000);
s.graphics.drawCircle(200, 180, 180);
var img:Image = new Image();
img.load("../res/images/dart1.png");
uiComponent.addChild(s);
//this doesn't work
//uiComponent.addChild(img);
//this does
vbox.addChild(img);
//this is what I really want (also doesn't work)
//s.addChild(img);
}
]]>
</mx:Script>
</mx:Application>
[Q]The Container class contains the logic for scrolling, clipping, and dynamic
instantiation. It contains methods for adding and removing children. It also
contains the getChildAt() method, and the logic for drawing the background and
borders of containers.[/Q]