AS3.0想把库中的元件 通过元件名加载到舞台,但是提示Mc1没有定义 为什么 10
package{importflash.display.Sprite;importflash.display.MovieClip;importflash.utils.ge...
package
{
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.utils.getDefinitionByName;
public class MainForm extends Sprite
{
public function MainForm()
{
var myClass:Class = getDefinitionByName("Mc1") as Class;
var myTest:MovieClip = new myClass();
addChild(myTest);
myTest.x=200;
myTest.y=200;
}
}
} 展开
{
import flash.display.Sprite;
import flash.display.MovieClip;
import flash.utils.getDefinitionByName;
public class MainForm extends Sprite
{
public function MainForm()
{
var myClass:Class = getDefinitionByName("Mc1") as Class;
var myTest:MovieClip = new myClass();
addChild(myTest);
myTest.x=200;
myTest.y=200;
}
}
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询