|
|
« Предыдущая тема | Следующая тема » |
Опции темы | Опции просмотра |
|
|
|||||
Регистрация: Jul 2009
Сообщений: 93
|
Fullscreen + Timer = SecurityError ?
Добрый день,
пытаюсь поменять displayState на fullscreen после небольшой задержки с помощью Timer, но срабатывает SecurityEvent #2152. Интересно, что если поменять displayState на fullscreen без Timer, то все работает отлично. import flash.events.MouseEvent; import flash.utils.Timer; import flash.events.TimerEvent; buttonWithTimer.addEventListener(MouseEvent.CLICK, onDelayedClick); buttonNormal.addEventListener(MouseEvent.CLICK, onNormalClick); var timer:Timer; function onNormalClick(e:MouseEvent):void { toogleFullscreen(); } function onDelayedClick(e:MouseEvent):void { timer = new Timer(300, 1); timer.addEventListener(TimerEvent.TIMER, onTimerFinish); timer.start(); } function onTimerFinish(e:TimerEvent):void { toogleFullscreen(); if(timer) { timer.removeEventListener(TimerEvent.TIMER, onTimerFinish); timer = null; } } function toogleFullscreen():void { if (stage.displayState == "normal") { try { stage.displayState = "fullScreen"; } catch(e:Error) { debugTxt.appendText("\n Error: "+e.toString()); } } else { stage.displayState = "normal"; } } Fla'шка: http://dl.************/u/3307294/test...screenTest.fla Не пойму что делать, уже 3 часа убил на это. |
|
|||||
http://www.adobe.com/livedocs/flash/...l#displayState
Full-screen mode is initiated in response to a mouse click or key press by the user; the movie cannot change Stage.displayState without user input. While Flash Player is in full-screen mode, all keyboard input is disabled (except keyboard shortcuts that take the user out of full-screen mode). A Flash Player dialog box appears over the movie when users enter full-screen mode to inform the users they are in full-screen mode and that they can press the Escape key to end full-screen mode.
__________________
flash portfolio |
|
|||||
[+1 01.06.10]
[+1 18.05.10] Регистрация: Apr 2010
Сообщений: 128
|
проще говоря, создайте кнопку и нажмите ее через диспатчинг, через нужное время …*например так
.... var goFullButt:Sprite; goFullButt = new Sprite(); goFullButt.addEventListener(MouseEvent.CLICK,handlerGoFull); .... function handlerGoFull(event:Event):void { toogleFullscreen(); } function onTimerFinish(e:TimerEvent):void { goFullButt.dispatchEvent(new Event(MouseEvent.CLICK,true)); if(timer) { timer.removeEventListener(TimerEvent.TIMER, onTimerFinish); timer = null; } }
__________________
md5 еще какое то (я так понял кодировка) … вот такие дела )) |
Часовой пояс GMT +4, время: 11:04. |
|
« Предыдущая тема | Следующая тема » |
Теги |
fullscreen , securityerror , timer |
|
|