away3d / away3d-core-openfl

Away3D engine for OpenFL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flash working on Standalone but not in browser

MangelMaxime opened this issue · comments

I have something really weird.

I have a flash sample that is working when running on desktop with standalone flash but when I try using it in browser it's just showing a black screen.

You can find the swf file here

And here is a repo with my sources.

Sorry for the code quality, it's just for testing and learning.

To run Stage3D content in Flash through a browsers you need to embed it in a HTML page typically using SWFObject and setting the wmode parameter to direct.

The HTML looks like :

<!DOCTYPE html>
<html>
    <head>
        <title>TestAway3D</title>
        <script type="text/javascript" src="swfobject.js"></script>
        <script type="text/javascript">
            swfobject.embedSWF ("TestAway3D.swf", "openfl-application", "100%", "100%", "11.2", "expressInstall.swf", {}, { wmode:"direct" });
        </script>
        <style>
            html, body, #openfl-application { width:100%; height:100%; }
            body { margin:0; padding:0; overflow:hidden; }
        </style>
    </head>
    <body>
        <div id="openfl-application" />
    </body>
</html>

You just need to grab a copy of 'swfobject.js' and 'expressinstall.swf'. Here is a link to the test page I set up and the zip.

Test page : http://jsaway.com/playground-files/Test/index.html
Zip of files (without the SWF) : http://jsaway.com/playground-files/TestAway3D.zip

That should get things going for you.

Greg