URLLoad problem when testing a movie

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 {
	connxn.load(urlRequest);
} 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

jashawAsked:
Who is Participating?
 
blue-genieConnect With a Mentor Commented:
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).
0
 
rascalpantsCommented:

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...

http://faindu.wordpress.com/2008/04/18/ie7-ssl-xml-flex-error-2032-stream-error/


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


rp / ZA


0
 
jashawAuthor Commented:
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?
0
 
rascalpantsCommented:

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

0
 
rascalpantsCommented:
Please finish up the question.


rp / Flash Zone Advisor
0
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.

All Courses

From novice to tech pro — start learning today.