URLLoad problem when testing a movie

Posted on 2009-05-17
Medium Priority
Last Modified: 2015-01-05
I am using URLLoader to load data from a remote server.  I have a crossdomain policy file on the remote server setup to allow access from anywhere, and all works as expected (i.e. the loaded() function is called)  if I load the SWF from the same domain (http://www.mydomain.com/test.swf), or a different domain (http://www.myotherdomain.com/test.swf) or if I run the local swf in a standalone player, or if I debug the movie in Flash CS3 (Ctrl-shift-enter).  But if I test the movie from Flash (Ctrl-Enter) I get an ioError "Error #2032: Stream Error. URL: http://www.mydomain.com/myscript.php"

What's happening here?
var connxn:URLLoader;
var urlRequest:URLRequest;
connxn=new URLLoader();
connxn.addEventListener(Event.COMPLETE, loaded);
connxn.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
urlRequest=new URLRequest('http://www.mydomain/myscript.php');
try {
} catch (error:SecurityError) {
	dbg.text = 'security error';
function loaded(e:Event) {
	dbg.text = 'loaded';
function errorHandler(e:IOErrorEvent):void {
	dbg.text = e.text;

Open in new window

Question by:jashaw
  • 3
LVL 22

Expert Comment

ID: 24412961

This doesn't sound like a code issue, but more of a security issue, as you have already found out.

maybe try to change your local FLA/SWF playback settings to "Access Network only".

here are some other articles that might point you in the right direction...


what does your "myscript.php" do?  what are you loading into the Loader?

rp / ZA


Author Comment

ID: 24415160
The local playback settings are already at "Network only".  I assume it is a security issue, but my crossdomain policy file is obviously correct since I can access myscript.php for the swf loaded from other domains, and from my local machine if I use the standalobe player.

myscript.php simply echos some text ... literally "<?php echo "blah"; ?>

I guess the question is, why is the standalone player behaving differently from the player invoked directly from the IDE?
LVL 22

Expert Comment

ID: 24415305

mainly because they are different...  Flash, the IDE, has these permissions, but for some reason your environment is not allowing this...

have you tried this on another computer?

this one I think has stumped me  :)

rp / ZA

LVL 39

Accepted Solution

blue-genie earned 1500 total points
ID: 24509372
try this from help file

The Global Flash Player Trust directory
Administrative users and installer applications can register specified local SWF files as trusted. These SWF files are assigned to the local-trusted sandbox. They can interact with any other SWF files, and they can load data from anywhere, remote or local. Files are designated as trusted in the Global Flash Player Trust directory, which is in the same directory as the mms.cfg file, in the following locations (locations are specific to the current user):

Windows: system\Macromed\Flash\FlashPlayerTrust
(for example, C:\windows\system32\Macromed\Flash\FlashPlayerTrust)

Mac: app support/Macromedia/FlashPlayerTrust
(for example, /Library/Application Support/Macromedia/FlashPlayerTrust)

The Flash Player Trust directory can contain any number of text files, each of which lists trusted paths, with one path per line. Each path can be an individual SWF file, HTML file, or directory. Comment lines begin with the # symbol. For example, a Flash Player trust configuration file containing the following text grants trusted status to all files in the specified directory and all subdirectories:

# Trust files in the following directories:
C:\Documents and Settings\All Users\Documents\SampleApp

The paths listed in a trust configuration file should always be local paths or SMB network paths. Any HTTP path in a trust configuration file is ignored; only local files can be trusted.

To avoid conflicts, give each trust configuration file a filename corresponding to the installing application, and use a .cfg file extension.

As a developer distributing a locally run SWF file through an installer application, you can have the installer application add a configuration file to the Global Flash Player Trust directory, granting full privileges to the file that you are distributing. The installer application must be run by a user with administrative rights. Unlike the mms.cfg file, the Global Flash Player Trust directory is included for the purpose of installer applications granting trust permissions. Both administrative users and installer applications can designate trusted local applications using the Global Flash Player Trust directory.

There are also Flash Player Trust directories for individual users (see the next section, User controls).
LVL 22

Expert Comment

ID: 24530897
Please finish up the question.

rp / Flash Zone Advisor

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question