0

I want to have a flash game with a link at the bottom that says "Fullscreen" and when you click it as though it was a link it will scale a flash object to be as big as your screen without stretching it, or refreshing it. My blog can be found at bestjavascriptgames.blogspot.com The link for fullscreen is NOT there right now because I don't want people asking about it. Also I have been trying out different display techniques so right now the menu only has 4 games available. It normally has more but for now it has 4.

4

2 回答 2

0

只要链接在 Flash 对象内,就很容易实现:

stage.scaleMode = StageScaleMode.NO_SCALE;

fullscreenBtn.addEventListener(MouseEvent.CLICK, goFullscreen);
function goFullscreen(e:MouseEvent):void
{
    stage.displayState = StageDisplayState.FULL_SCREEN;
}
于 2012-07-24T23:09:34.433 回答
0

鉴于您所说的,在我的回答期间,我将假设您所需的知识需要以 HTML 的形式。

而不是一个“链接”(一个<a href=""></a>),以防止重新加载你需要的是一个<span></span>或<a></a>(没有一个href..不是技术上有效的 HTML),它只有一个 onclick 属性和您的网站需要的任何样式。

该 onclick 应该运行与您的 flash 对象交互的 JavaScript,将其称为内部全屏例程。这不会因任何重新加载而受到惩罚。我把剩下的留作一个关于如何调用 Flash 对象的研究项目——网上有很多例子,你可以根据自己的需要进行调整,我不想猜测如何为你的特定 Flash 对象做这件事。

于 2012-07-24T23:26:16.807 回答