PDA

View Full Version : LoadMovie error message


Ian Webster
09-21-2003, 10:53 AM
I am using the following to prevent an external .swf file from being cached

loadMovie ("helenbarnes/helenbarnes.swf?unique=" + Math.floor(random(1000000)/random(1000)), "image4");

Seems to work fine when viewed in a browser from the server but I get the following error message when I test the movie from within Flash (version 5)

Error opening URL "file:///F|/ian/dwm/helenbarnes/helenbarnes.swf?unique=1188"


Is there a way to prevent this error?

thx
Ian

Colin Campbell
09-21-2003, 02:23 PM
Welcome to the forums Ian,

have you tried typing it in a different way? Its hard to explain, when you have a file on your comp, I'm quite sure you need an exact url to it. That might be your problem...

Sorry I couldn't be of more help,
Colin

Ian Webster
09-21-2003, 02:33 PM
thanks, Colin

If I put the full URL for this external file, I will need to upload it to the server every time I make changes before I can test it locally (if you see what I mean)....this could become a bit of a drag

The relative path has been working fine both locally and on the eventual server

HOWEVER when I added the random qualifier on the end (to stop the caching), it now generates an error locally but not when run on the final server?

Any ideas?

thx
Ian

Ian Webster
09-21-2003, 02:53 PM
ok, I now understand what is causing this:

when the browser makes a call to the server the .swf file downloaded is put into cache with a name that includes the random qualifier

for example "helenbarnes.swf?unique=1188"

BUT when running locally, the code calls a filename which doesn't exist locally (cannot because the qualifier part of the name is random!!)

So.....

is there anything in flash like DEBUG in C compilers

ie

if(DEBUG)
do this
else
do that


any help appreciated

thx
Ian

Ian Webster
09-21-2003, 03:38 PM
this is what I have ended up with for anyone who is interested - a unique qualifier is added only if the movie is drawn from the server - however, the qualifier is omitted if the movie is being tested from the flash IDE

if (_url.substr(0,_url.indexOf(":")) == "file")
{
loadMovie (id + "/" + id + ".swf", "image4");
}
else
{
loadMovie (id + "/" + id + ".swf?unique=" + Math.floor(random(1000000)/random(1000)), "image4");
}