访问 AS3 中的舞台
我试图让投影仪文件在启动时全屏运行,而不需要单击任何内容。我的主类继承自 MovieClip,因此据我所知,我可以访问舞台...是的,对:)
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.StageDisplayState;
import flash.display.Stage;
import flash.ui.Mouse;
public class PhoneDemo extends MovieClip
{
Stage.displayState=StageDisplayState.FULL_SCREEN;
//declare variables
public var scoreArray:Array = [null];
这根本不起作用,我无法访问舞台,我收到错误 1120。当然我以前也曾登上过舞台,但我真的很困惑。
I'm trying to get a projector file to run full screen when it starts, without needing to click anything. My main class inherits from MovieClip, so as far as I can tell I get access to stage... yeah right :)
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.StageDisplayState;
import flash.display.Stage;
import flash.ui.Mouse;
public class PhoneDemo extends MovieClip
{
Stage.displayState=StageDisplayState.FULL_SCREEN;
//declare variables
public var scoreArray:Array = [null];
This simply doesn't work, I can't gain access to stage, I get error 1120. I'm sure I've gained access to the stage before, I'm really confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
stage
是 DisplayObject 的一个属性;Stage
是类。尝试以小写形式访问它。另外,如果您在构造函数中访问阶段,那么它还没有被分配。
stage
is a property of DisplayObject;Stage
is the class.Try accessing it in lowercase instead. Also, if you access the stage in the constructor it won't have been assigned yet.