Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/actionscript-3/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 为什么鼠标事件不能在全屏上工作_Actionscript 3_Flash Cs5 - Fatal编程技术网

Actionscript 3 为什么鼠标事件不能在全屏上工作

Actionscript 3 为什么鼠标事件不能在全屏上工作,actionscript-3,flash-cs5,Actionscript 3,Flash Cs5,如果我这样做: stage.displayState=StageDisplayState.FULL\u SCREEN\u INTERACTIVE 投影仪将全屏显示,但没有鼠标事件工作,你知道如何解决这个问题吗 编辑 以下是我的实现: stage.displayState =StageDisplayState.FULL_SCREEN_INTERACTIVE; stage.mouseLock = true; 只有在windows中创建项目时才会出现此问题,而鼠标事件不起作用 编辑2 编辑3: 如果

如果我这样做:

stage.displayState=StageDisplayState.FULL\u SCREEN\u INTERACTIVE

投影仪将全屏显示,但没有鼠标事件工作,你知道如何解决这个问题吗

编辑

以下是我的实现:

stage.displayState =StageDisplayState.FULL_SCREEN_INTERACTIVE;
stage.mouseLock = true;
只有在windows中创建项目时才会出现此问题,而鼠标事件不起作用

编辑2

编辑3:

如果我检查event FullScreenEvent.FULL_SCREEN并尝试设置stage.mouseLock=true

我得到这个错误:

[Fault] exception, information=Error: Error #3707: Property can not be set in non full screen mode
当应用程序进入全屏时,尝试将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>

您是否尝试在进入全屏后将stage.mouseLock设置为true?是否应在设置stage.mouseLock=true;之前触发等待全屏交互接受;?但是,如何检测事件?您应该添加相关代码,而不是编辑问题。查看完整的代码很难说有什么问题。请参阅EDIT2,由于某些原因,处理程序没有被调用。现在正在调用处理程序,但我收到以下错误:[Fault]exception,information=error:error 3707:属性无法在非全屏模式下设置。您使用的是哪个版本的Flash Player?这似乎是11.3版中的一个bug,您可以通过修改全屏事件处理程序来解决。检查此链接:感谢链接,它成功了!但是,对于所有FLV播放组件,我必须将fullscreenTakeOver切换为false:
// 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>