This content has been marked as final. Show 5 replies
Sorry I have to rephrase the word - detect - to "check", sounds more pricisely...
How can I check a file (a jpg or flv) exists in a folder?
for instance flash can check if there is an instance exist or not on the timeline, for example a movie clip is called myMovie_mc.
trace("sorry myMovie_mc doesnot exist");
This is checking the instance on the timeline... but what I need is the check if a file (a flv file) exists or not in a folder outside the fla file.
If that flv does exist in that folder ("videos" I called it), then the flash will take some actions. if it does not exist, then flash will do something else, like gotoAndPlay("default Intro").
It will be much appreciated if anyone of you can sort this problem out for me.
there is a class called VideoError try to use that! it has a property called INVALID_CONTENT_PATH ;)
you can alternatively use the CONNECTION_ERROR property of the VideoPlayer class to check if the connection to the flv succeeded, but the first choice is better i think.
and of course you can write server side code to check if a file exists in the file system.
Thank you I will try INVALID_CONTENT_PATH later soon.
How do you write a server side code to check if the files exist or not please ....?
Using PHP, you'll probably use this code: file_exists($file)