Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by David Wn · Jan 07, 2013 at 09:57 PM · webplayerflashhtml

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
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges