Forum Sitebox Facebook + Flash - Crossdomain error

Discussion and help relating to the PlayerIO webpage and Facebook app hosting solution, Sitebox.

Facebook + Flash - Crossdomain error

Postby RiltonRamone » June 13th, 2015, 6:03 am

When my game is loaded, automatically try to find the crossdomain file over https://foo.fb.playerio.com/crossdomain.xml, but without success. Do you guys could tell me where I need to put my crossdomain file or if its YGN business?

Appreciate any help.
RiltonRamone
 
Posts: 4
Joined: February 17th, 2013, 2:40 am

Re: Facebook + Flash - Crossdomain error

Postby Henrik » June 16th, 2015, 6:46 pm

You shouldn't be able to serve out a Flash object from that domain in the first place, which is why there is no crossdomain.xml there. If you use the swf tag in https://gamesnet.yahoo.net/documentatio ... /templates it should serve out your GameFS file from a domain that has a proper crossdomain.xml
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Facebook + Flash - Crossdomain error

Postby RiltonRamone » June 17th, 2015, 12:34 am

Hi Henrik! Thank you for reply.

I am using the swf tag, here is my code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>O2Plus</title>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
background-color: 0xFFFFFF; }
object:focus { outline:none; }
#flashContent { display:none; }
</style>
<link rel="stylesheet" type="text/css" href="{% url 'history/history.css' %}" />
<script type="text/javascript" src="{% url 'history/history.js' %}"></script>
<script type="text/javascript" src="{% url 'swfobject.js' %}"></script>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '1639271606285157',
xfbml : true,
version : 'v2.3'
});

// ADD ADDITIONAL FACEBOOK CODE HERE
};

(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
{% block content %}
{% swf src='Main.swf' width='100%' height='100%' id='game' wmode='direct' %}
{% end %}
</body>
</html>
RiltonRamone
 
Posts: 4
Joined: February 17th, 2013, 2:40 am

Re: Facebook + Flash - Crossdomain error

Postby Henrik » June 17th, 2015, 8:46 pm

Using that tag means that the Flash file is hosted on a CDN domain, not foo.fb.playerio.com. The only reason you would need a crossdomain on foo.fb.playerio.com would be if the Flash game were to request a file from foo.fb.playerio.com, and why would it do that? If you use the GameFS classes in the client library to load assets, they'll all resolve to the same host that the Flash file itself is on.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Facebook + Flash - Crossdomain error

Postby RiltonRamone » June 21st, 2015, 11:34 pm

Thank you for explanation Henrik. It works. The problem was in my assets loader class, with relative paths.
RiltonRamone
 
Posts: 4
Joined: February 17th, 2013, 2:40 am

Re: Facebook + Flash - Crossdomain error

Postby strikvid » April 16th, 2022, 12:32 pm

If facebook hasn't put a crossdomain on their site, loadPolicyFile won't work.

However, what are you using to load the images? Usually, you don't need crossdomain.xml if you only want to display images.
strikvid
 
Posts: 1
Joined: April 16th, 2022, 12:31 pm


Return to Sitebox



cron