2011-11-29 13 views
1

私は2つのAS3機能を持っています。フルスクリーンを切り替えるものと、「Hello World」のみを記録するExternalInterfaceでjavascriptで呼び出されるもの。AS3フルスクリーンをjavascriptで呼び出す

ブラウザではうまく動作しますが、私はjavascriptのと同じ方法でフルスクリーン機能を呼び出そうと、私はこのようなエラーが発生します両方:

Error calling method on NPObject! 

私はその問題をグーグルだけに何かを持っていたこと同じドメインへのアクセスを行い、他の機能と連動している場合は、別のものにする必要があります。

私は間違っていますか?

答えて

4

フルスクリーンモードは、ユーザー入力によってのみ設定できます。だから私はjavascriptからそれを呼び出すことは許されていないaffraidです。

フルスクリーンモードは、マウスのクリックまたはキーに応答して開始されます。 ムービーは ユーザー入力なしでStage.displayStateを変更することはできません。 Flashランタイムは、フルスクリーン モードでキーボード入力を制限します。使用可能なキーには、 フルスクリーンモードを終了するキーボードショートカットと、矢印、スペース、Shift、 、Tabキーなどの非印字キーが含まれます。フルスクリーンモードを終了するキーボードショートカットは、 エスケープ(Windows、Linux、およびMac)、Control + W(Windows)、Command + W (Mac)、およびAlt + F4です。

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Stage.html#displayState

+0

私はそれが問題を引き起こしていたようなものだと考えました。ありがとうございました。 –

-2

間違いなくあなたは、Webブラウザで実行されているFlashムービーのためのフルスクリーンを開始することができます。しかし、あなたは... HTMLコードで有効になってフルスクリーンモードを確認する必要があり

このトピックをお読みください:

、以下の制限がHTMLページ(ないスタンドアローンのFlashを使用して、これらの内で再生するSWFファイルに適用されますPlayerまたはないAIRランタイムで実行されている):

* To enable full-screen mode, add the allowFullScreen parameter to the object and embed tags in the HTML page that includes the SWF file, with allowFullScreen set to "true", as shown in the following example: 

    <param name="allowFullScreen" value="true" /> 
      ... 
     <embed src="example.swf" allowFullScreen="true" ... > 

    An HTML page may also use a script to generate SWF-embedding tags. You need to alter the script so that it inserts the proper allowFullScreen settings. HTML pages generated by Flash Professional and Flash Builder use the AC_FL_RunContent() function to embed references to SWF files, and you need to add the allowFullScreen parameter settings, as in the following: 

    AC_FL_RunContent(... "allowFullScreen", "true", ...) 

* 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. Flash runtimes restrict keyboard input in full-screen mode. Acceptable keys include keyboard shortcuts that terminate full-screen mode and non-printing keys such as arrows, space, Shift, and Tab keys. Keyboard shortcuts that terminate full-screen mode are: Escape (Windows, Linux, and Mac), Control+W (Windows), Command+W (Mac), and Alt+F4. 

    A Flash runtime 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. 
* Starting with Flash Player 9.0.115.0, full-screen works the same in windowless mode as it does in window mode. If you set the Window Mode (wmode in the HTML) to Opaque Windowless (opaque) or Transparent Windowless (transparent), full-screen can be initiated, but the full-screen window will always be opaque. 

次にあなたがフルスクリーンを作るにStage.displayStateを変更するには、ActionScript 3.0での機能を確認する必要があります後。

actionscript 3.0関数をJavaScriptから呼び出すには、ActionScript 3.0のExternalInterface APIを使用します。 Adob​​e HelpのExternalInterfaceクラスAPIの説明を参照してください。

+0

-1これは完全に間違っています。 Flash Playerのセキュリティ機能は、アプリケーションがフルスクリーンモードを開始するのを禁止します(ユーザー入力なし) –

関連する問題