在我必须为大学制作的一个小游戏中,我在运行时渲染一个菜单,使用我在 illustrator 中绘制的按钮制作的电影剪辑。我像往常一样在 Flash Professional 中导入了 illustrator 文件,并像使用其他运行良好的影片剪辑一样建立了 AS 链接。但是当我尝试渲染这些按钮时,我得到一个错误 1009,一个空引用。顺便说一句,我用的是 AS3。
private function initMenuComponents():void{
var btnPlay:MovieClip = new Play();
var btnOptions:MovieClip = new Options();
var btnLikeOnFacebook:MovieClip = new LikeOnFacebook();
var btnShareOnFacebook:MovieClip = new ShareOnFacebook();
btnPlay.x = (stage.stageWidth / 2) - (btnPlay.width / 2);
btnOptions.x = (stage.stageWidth / 2) - (btnOptions.width / 2);
btnLikeOnFacebook.x = (stage.stageWidth / 2) - (btnLikeOnFacebook.width / 2);
btnShareOnFacebook.x = (stage.stageWidth / 2) - (btnShareOnFacebook.width / 2);
btnPlay.y = 100;
btnOptions.y = 150;
btnLikeOnFacebook.y = 200;
btnShareOnFacebook.y = 250;
stage.addChild(btnPlay);
stage.addChild(btnOptions);
stage.addChild(btnLikeOnFacebook);
stage.addChild(btnShareOnFacebook);
}