4,328
社区成员
发帖
与我相关
我的任务
分享
package {
import flash.display.Sprite;
import flash.text.TextField;
public class ASTest extends Sprite
{
public function ASTest()
{
var bigText:TextField = new TextField();
bigText.border = true;
bigText.text = "hello world";
bigText.width = 1000;
bigText.height = 1000;
bigText.x = 0;
bigText.y = 0;
addChild(bigText);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
xmlns:sx="*">
<mx:Script>
<![CDATA[
import mx.core.UIComponent;
private function onClickHandle():void{
var uicom:UIComponent=new UIComponent();
var asTest:ASTest = new ASTest();
uicom.addChild(asTest);
addChild(uicom);
}
]]>
</mx:Script>
<mx:HBox>
<mx:Spacer width="400"/>
<mx:Button id="sss" label="测试ASTest类的现实情况" click="onClickHandle()"/>
</mx:HBox>
</mx:Application>