Solved

URLLoad problem when testing a movie

Posted on 2009-05-17
6
585 Views
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 {
	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

0
Comment
Question by:jashaw
  • 3
6 Comments
 
LVL 22

Expert Comment

by:rascalpants
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...

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
 

Author Comment

by:jashaw
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?
0
 
LVL 22

Expert Comment

by:rascalpants
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

0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 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).
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 24530897
Please finish up the question.


rp / Flash Zone Advisor
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

749 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