AS3 嵌入代码错误
package {
import flash.display.*;
public class main extends Sprite {
[Embed(source="file.swf")]
public static const MY_FILE:Class;
public function main() {
var mySprite:Sprite = new MY_FILE() as Sprite;
trace("done " + MY_FILE);
addChild(mySprite);
}
}
}
我收到这个错误。
done [class main_MY_FILE]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Filters()
有谁知道是什么原因吗?
package {
import flash.display.*;
public class main extends Sprite {
[Embed(source="file.swf")]
public static const MY_FILE:Class;
public function main() {
var mySprite:Sprite = new MY_FILE() as Sprite;
trace("done " + MY_FILE);
addChild(mySprite);
}
}
}
am getting this error.
done [class main_MY_FILE]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Filters()
Does anyone know what is the reason?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题可能出在您的嵌入式 swf 中。你的脚本看起来不错。
The problem is probably in your embedded swf. Your Script seems fine.