I'm trying to load external XML and JPEGS using loadMovie and XML.load but keep getting intermittent "Error opening URL" messages. Sometimes the resources load othertimes not.
Looking at the server logs, there are no 404 errors and System.security.allowDomain has been set.
I've used onLoad for XML and created a preloader for the JPEG which will retry when a failure occurs BUT even doing this doesn't always work.
Does anyone have any suggestions? or had similar experiences?
I've trawled the net and this site and come up blank, so any comments would be very much appreciated. Thank you.
so the xml resource cannot be loaded show me the path you use for loading the xml are you loading the file onto a webserver to test it or are you testing it locally ? .......showing me the path to the problem file will probably be enough for me to figure out what is happening.
by external do you mean the files are on a different server?
if you try loading stuff from a different server than the one hosting your flash app, you need to put a crossdomain.xml on that other server allowing the app to access the files.
by external do you mean the files are on a different server?
if you try loading stuff from a different server than the one hosting your flash app, you need to put a crossdomain.xml on that other server allowing the app to access the files.
Hi theTick,
Both the xml and jpegs are on the same server (and domains) - although, this isn't the case when I'm testing in the authoring environment. The problem is intermittent, rather than just not allowing me to access the resources at all (and behaves the sames for a variety of domain names e.g. localhost, http://testserver/project, etc).
lets trace the actual resources being loaded are you using loadMovie to load the jpeg?? trace the jpegs container and see if it...is getting anything in it wheter it be the bitmap or [object object].......make a trace on the function that fires the image being loaded like this .....trace("yes it fired"); and put that in the function that loads the jpeg so we can make sure that its fireing everytime does it work if you test it in the flash environment ?? if it works each time in the flash environment (when you press cntrl enter) then we at least know the code is working properly....if you want to see your functions fireing in the browser then use msg0.text = "yes it fired" ; and place a dynamic text box on the stage ....and put the msg0.text code in the function you wish to test.
error opening url messages? are you compiling the .swf on the webserver ?? you do know the .swf and php have to be on the webserver in order for the php to fire right?
assets is not the root folder of the webserver right...because ......localhost is referring to the root folder of the webserver ........try putting the jpeg in the first folder of your webserver and then say http://localhost/crt25w.jpg....also flash is case sensitive in its paths so make sure you don't have crt25.JPG instead of crt25.jpg
you have a path problem....i think your xml and everything is working properly.....sometimes i forget to try the simplest solution first....I will await an answer about my last post...
assets is not the root folder of the webserver right...because ......localhost is referring to the root folder of the webserver ........try putting the jpeg in the first folder of your webserver and then say http://localhost/crt25w.jpg....also flash is case sensitive in its paths so make sure you don't have crt25.JPG instead of crt25.jpg
Unfortunately, I can't put the jpeg's into the root level of the domain because they are content managed - the urls above are also generated by the php, so no room for silly typos, and I've double checked that they are indeed case and character perfect.
Does flash have problems loading assets from different folders?
As you can see from the trace, the URLs include the domain and full path. Though, in one incarnation, the siteprefix is set to just '/' i.e. without the http://localhost.
always..../root_folder/assestfolder/crt.jpg has always given me problems as well as c:/root_folder/asset_folder/crt.jpg.... and i don't think c:\root_folder\assest_folder\crt.jpg....works in flash.........you are using windows as a server right?
use absolute paths ...http://localhost /asset_folder/crt.jpg
always..../root_folder/assestfolder/crt.jpg has always given me problems as well as c:/root_folder/asset_folder/crt.jpg.... and i don't think c:\root_folder\assest_folder\crt.jpg....works in flash.........you are using windows as a server right?
Definitely using absolute paths... at least in this incarnation.
(I'm using Linux as the server Mandriva on my dev. machine and Fedora on the live server).
now i'm thinking you aren't waiting ...for the jpegs to load before you put them in their respective movie clip containers...........you need to use an onload event to fire only after the movieclip container loads.....hold on a minute i have to decrypt some files before i can give you a more definate answer on how to use the onload method with loadMovie.