如果我这样做了:
stage.displayState =StageDisplayState.FULL_SCREEN_INTERACTIVE
放映机会转到全屏,但没有鼠标事件工作,知道如何解决这个问题吗?
编辑
以下是我的实现:
stage.displayState =StageDisplayState.FULL_SCREEN_INTERACTIVE;
stage.mouseLock = true;只有在windows中创建项目时,才会出现此问题,鼠标事件不起作用。
EDIT2
stage.addEventListener(FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED, fullscreenHandler);
stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullscreenHandler);
stage.displayState =StageDisplayState.FULL_SCREEN_INTERACTIVE;
// BUT THIS HANDLER IS NOT CALLED
function fullscreenHandler(event:FullScreenEvent):void {
if(event.type == FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED) {
stage.mouseLock = true;
}
}编辑3:
如果我检查事件FullScreenEvent.FULL_SCREEN并尝试设置stage.mouseLock = true;
if(event.type == FullScreenEvent.FULL_SCREEN) {
stage.mouseLock = true;
}我知道这个错误:
[Fault] exception, information=Error: Error #3707: Property can not be set in non full screen mode发布于 2014-05-26 06:40:51
当应用程序进入全屏时,尝试将stage的mouseLock属性设置为true:
public function fullScreenHandler(event:FullScreenEvent):void {
if(event.type == FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED) {
stage.mouseLock = true;
}
}添加上面的事件处理程序如下:
// will be fired when the user clicks the 'allow' button for fullscreen interactive
stage.addEventListener(FullScreenEvent.FULL_SCREEN_INTERACTIVE_ACCEPTED, fullscreenHandler);
// will be fired when enter/exit fullscreen
stage.addEventListener(FullScreenEvent.FULL_SCREEN, fullscreenHandler);要能够在全屏模式下工作,还必须在嵌入代码中添加以下参数:
<object>
<param name="allowFullScreen" value="true" />
<embed src="example.swf" allowfullscreen="true" />
</object>https://stackoverflow.com/questions/23863855
复制相似问题