Flash/AIR AS3 应用程序在启动时全屏显示的问题(在 MAC 上)
我已经在 Flash CS4 和 AS3 中创建了一个 AIR 应用程序,并且该应用程序需要以全屏模式启动。我对全屏调用稍作延迟,以避免 Flash 不允许您以全屏方式启动应用程序。这在 Windows 上运行良好。但是,在 Mac 上,我的应用程序有一个问题...
它使用此代码在启动时进入全屏:
var fullscreen_delay:Timer=new Timer(10,1);// delay to bypass flash's non-fullscreen-on-startup feature
fullscreen_delay.start();
fullscreen_delay.addEventListener(TimerEvent.TIMER_COMPLETE, function(){
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
fullscreen_delay.removeEventListener(TimerEvent.TIMER_COMPLETE,arguments.callee);
fullscreen_delay=null;
});
应用程序成功进入全屏,但将应用程序的窗口保留在全屏视图前面。通过按键切换全屏可以解决此问题。我认为做这样的事情:
var fullscreen_delay:Timer=new Timer(10,1);// delay to bypass flash's non-fullscreen-on-startup feature
fullscreen_delay.start();
fullscreen_delay.addEventListener(TimerEvent.TIMER_COMPLETE, function(){
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
fullscreen_delay.removeEventListener(TimerEvent.TIMER_COMPLETE,arguments.callee);
fullscreen_delay=null;
stage.displayState=StageDisplayState.NORMAL;
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
});
或者甚至延迟额外的 StageDisplayState.NORMAL;
和 `StageDisplayState.FULL_SCREEN_INTERACTIVE;每个 100 毫秒都会模拟按键切换的效果,这为这个问题提供了一个功能性的、虽然肮脏的解决方法。然而,这些东西都不起作用。
有谁知道发生了什么事吗?
[编辑]
在全屏通话上设置一个长得离谱的延迟(5000 毫秒)似乎可以解决问题。当我启动应用程序并立即开始按下空格键(我的全屏切换键)时,我意识到了这一点,这一直向我展示相同的问题,直到 3 或 4 秒后,此时全屏开始正常工作。
不过,如果有人知道这件事......请分享。
I've created an AIR application in Flash CS4 with AS3, and the application needs to start up as fullscreen. I put a slight delay on the fullscreen call to get around the fact that flash won't let you start an application in fullscreen. This works fine on windows. However, on Mac, my application has an issue...
It uses this code to go fullscreen on startup:
var fullscreen_delay:Timer=new Timer(10,1);// delay to bypass flash's non-fullscreen-on-startup feature
fullscreen_delay.start();
fullscreen_delay.addEventListener(TimerEvent.TIMER_COMPLETE, function(){
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
fullscreen_delay.removeEventListener(TimerEvent.TIMER_COMPLETE,arguments.callee);
fullscreen_delay=null;
});
The application successfully goes fullscreen, but leaves the window for the application sitting in front of the fullscreen view. Toggling in and out of fullscreen on keypress fixes the issue. I thought that doing something like this:
var fullscreen_delay:Timer=new Timer(10,1);// delay to bypass flash's non-fullscreen-on-startup feature
fullscreen_delay.start();
fullscreen_delay.addEventListener(TimerEvent.TIMER_COMPLETE, function(){
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
fullscreen_delay.removeEventListener(TimerEvent.TIMER_COMPLETE,arguments.callee);
fullscreen_delay=null;
stage.displayState=StageDisplayState.NORMAL;
stage.displayState=StageDisplayState.FULL_SCREEN_INTERACTIVE;
});
Or even delaying the extra StageDisplayState.NORMAL;
and `StageDisplayState.FULL_SCREEN_INTERACTIVE; by 100 milliseconds each would simulate the effect of the keypress toggle, and this provide a functional, albeit dirty, workaround to this problem. However, these things do not work.
Does anyone have any idea what is going on?
[EDIT]
Putting a ridiculously long delay on the fullscreen call (5000 milliseconds) seems to do the trick. I realized this when I launched the application and immediately started mashing the space bar (my fullscreen toggle key), which kept presenting me with the same issue until after 3 or 4 seconds, at which point the fullscreen began working properly.
Still, if anyone knows anything about this... please share.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在全屏调用上设置一个长得离谱的延迟(5000 毫秒)似乎可以解决问题。当我启动应用程序并立即开始按下空格键(我的全屏切换键)时,我意识到了这一点,这一直向我展示相同的问题,直到 3 或 4 秒后,此时全屏开始正常工作。
不过,如果有人知道这件事......请分享。
Putting a ridiculously long delay on the fullscreen call (5000 milliseconds) seems to do the trick. I realized this when I launched the application and immediately started mashing the space bar (my fullscreen toggle key), which kept presenting me with the same issue until after 3 or 4 seconds, at which point the fullscreen began working properly.
Still, if anyone knows anything about this... please share.