- Home /
Webplayer and Flash Player in same page.
I'm trying to play a swf over my Web Player window while the game loads in the background. I minimize the unity window to 0, 0 and play the flash over it. When the flash movie is complete it restores the Unity window to 800, 600. The re-sizing is working fine, however when I enable the code to play a swf it throws this error:
Unsafe JavaScript attempt to access frame with URL https://apps.facebook.com/gr_dev_zero/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=4_0 from frame with URL https://dev0.grsandbox.info/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=4_0. The frame being accessed set 'document.domain' to 'facebook.com', but the frame requesting access did not. Both must set 'document.domain' to the same value to allow access.
It seems to throw this error if I use the video, object, embed tags.
Here's the code on the page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<title>Flirt Planet 3D</title>
<link rel="stylesheet" type="text/css" href="my.css" />
<script type="text/javascript" src="UnityObject.js"></script>
<script type="text/javascript">
window.fbAsyncInit = function()
{
// init the FB JS SDK
FB.init({
appId : "<?php echo $service->config->app_id; ?>", // App ID from the App Dashboard
channelUrl : 'www.dev0.grsandbox.info/channel.html',
status : true, // check the login status upon init?
cookie : true // set sessions cookies to allow your server to access the session?
});
};
function ResizeUnity(value)
{
var win = document.getElementById("unityPlayer");
win.style.width = (value/800)+"px";
win.style.height = (value/600)+"px";
}
function CloseMovie()
{
var win = document.getElementById('flashContent');
win.parentNode.removeChild(win);
ResizeUnity(1);
}
window.onload = function()
{
<?php
if($fp_id == -1)
{
?>
ResizeUnity(0);
<?
}
else
{
?>
var win = document.getElementById('flashContent');
win.parentNode.removeChild(win);
<?
}
?>
}
function GetUnity()
{
if (typeof unityObject != "undefined")
{
return unityObject.getObjectById("unityPlayer");
}
return null;
}
if (typeof unityObject != "undefined")
{
unityObject.embedUnity("unityPlayer", "WebPlayer<?php if(isset($_GET['_b'])) { echo $_GET['_b']; } ?>.unity3d", 800, 600);
}
</script>
</head>
<body>
<center>
<div class="menu">
<div class="m1"></div>
<div class="m2" onclick="location.href='index.php';"></div>
<div class="m3" onclick="InviteFriends()"></div>
<div class="m4" onclick="location.href='gold.php'"></div>
<div class="m5" onclick="location.href='forum.php';"></div>
<div class="m6" onclick=""></div>
<div class="m7" onclick="location.href='help.php';"></div>
<div class="m8"></div>
</div>
<div id="content">
<div id="unityPlayer">
<div class="missing">
<a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">
<img alt="Unity Web Player. Install now!" src="Images/Missing.png" width="800px" height="600" />
</a>
</div>
</div>
<div id="flashContent">
<object type="application/x-shockwave-flash" data="movie_player.swf" width="800" height="600">
<param name="movie" value="movie_player.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="false" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="samedomain " />
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</object>
</div>
</div>
</center>
</body>
</html>
Comment
Your answer
Follow this Question
Related Questions
Games and websites 1 Answer
Flash to html communication 1 Answer
JavaScript --> Unity Flash Build 2 Answers
flash site 1 Answer
FlashPlayerTemplates? 0 Answers