折腾了半天,终于查出来了。
flex 中没有UIcomponent将无法显示
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="Draw();">
<mx:Script>
<![CDATA[
import flash.display.Graphics;
import flash.geom.*;
import mx.core.*;
public var myShape:Shape=new Shape();
public var ui:UIComponent =new UIComponent(); //flex 中没有UIcomponent将无法显示
public function Draw():void{
myShape.graphics.lineStyle(3,0xFFFF00);
myShape.graphics.beginFill(0xFFFF00);
myShape.graphics.drawCircle(250,200,150);
myShape.graphics.endFill();
ui.addChild(myShape);
this.addChild(ui);//UI添加到舞台
}
]]>
</mx:Script>
</mx:Application>