Sandbox/Security issues
If we trying to run our game on a server it won't work... oh no. but fear not we will dig into the Security error and discover that its connected to the crossDomain.xml.
lets jump into the video and see why our game isn't working when we put it up on a server and how we can sort this problem out.
Video Transcript
00:00Now that we have our application running we have one more problem if we try to throw it up on a server as I did
00:06Right here, and you'll just I'm gonna click refresh to see what happens as I'm running a flash debugger
00:11You're gonna see that we're gonna get an error message telling us that we have a sandbox security violation
00:17Let's see what that means and why actually this is happening
00:20so I'm just gonna jump back into my flash for a second and go back into our main and
00:25Just copy here a main end and if you grab the RSS feed
00:29Copy it and go back in to the browser and just open it up in a new feed a new URL
00:34You'll see that it's loading without any problem
00:38Flash has this kind of like different way of approaching
00:42Testing to see if files if we're allowed to have access to files or not the way it tests things out
00:47It checks to see on the server to see if it has a cross domain
00:51XML now as you can see in the cross domain of Twitter Twitter basically enables only specific
00:58Domains to have access to their information and in a nutshell. It says only Twitter is allowed to access it
01:05Now that doesn't really work for us because we want to load it on our own server. Maybe
01:11The way around that the way for us to work with the Twitter
01:14RSS feed is to be able to pull that RSS feed from a different place where that different place might not have
01:20Those strictness and you'll see that in our source files
01:23I've added another feed and it's commented out which you could
01:27Uncomment it publish it and run your application one more time
01:30And then if you throw it on the server it would work like it's working on our domain and if we look at the Google
01:37RSS feed which is feed burner which belongs to
01:40Google we're basically I basically created an RSS feed that just grabs information from Twitter
01:47Now if you check in this feed the cross domain
01:52XML file well this one it forces you to download it, so we'll download it and
01:58then let's just double click on it and
02:01Open it up and as we open it up. We're going to see that our cross domain file here
02:06Let's everyone a star tells us that anyone could download it and because our cross domain and feeds that feed burner is
02:14Enabled it would enable our application to run so let's go back to our application
02:19So if I change from localhost and actually to the file. It's on the server itself
02:27We'll see that on the server itself. We're not getting any error because we're using that RSS feed instead
