gpt4 book ai didi

javascript - 如何从 javascript 检查 flash 对象是否处于全屏模式

转载 作者:行者123 更新时间:2023-11-29 22:29:19 25 4
gpt4 key购买 nike

我需要从 javascript 检查给定的 flash 对象是否处于全屏模式。我知道有 stage.displayState 属性,但如何使用 GetVariable 访问它?还是有其他方法?

谢谢。

附言如果您知道如何使用任何其他语言来做到这一点,那也没关系。

最佳答案

您可能需要在 AS 中添加一个可以从 JS 层调用的函数:

// In your AS code
import flash.external.ExternalInterface;
import flash.display.StageDisplayState;

// Register a function you can call from JS
ExternalInterface.addCallback("isFullScreen", _isFullScreen);

// Returns true if fullscreen
private function _isFullScreen() :Boolean {
return stage.displayState === StageDisplayState.FULL_SCREEN:
};

那么,你应该可以从 JS 中调用它了:

// Get a reference to the object element, change
// 'flashcontent' to the ID of your .swf in the DOM
var o = document.getElementById('flashcontent'),
// Figure out it the player is in fullscreen mode
isFullScreen = o.isFullScreen();
// Do something with isFullScreen value

外部接口(interface)文档 here ,舞台展示状态here .

希望对您有所帮助。干杯!

关于javascript - 如何从 javascript 检查 flash 对象是否处于全屏模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7794221/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com