MXML文件如何引用文档类?
我建了一个文档类如下:
package begin{ import flash.text.*; import flash.display.Sprite; [swf(width="400",height="200",frameRate="25",backgroundColor="#ffffff")] public class begintest extends Sprite { public function begintest() { var mytext:TextField=new TextField(); mytext.autoSize=TextFieldAutoSize.LEFT; mytext.text="这是一个测试"; var myformat:TextFormat=new TextFormat(); myformat.size=55; myformat.color=0x336699; mytext.setTextFormat(myformat); addChild(mytext); } }}
<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="addtest()"><mx:Script> <![CDATA[ import begin.begintest; protected function addtest():void{ var begin:begintest=new begintest(); } ]]></mx:Script></mx:Application>