views:

59

answers:

1

I need to check for file existence in Flash on x number of videos. I've tried LoadVars and MovieClipLoader. LoadVars works but it actually loaded the entire video before reporting its done. Without a way of knowing that its started, I can't delete it before its done. I don't what to load the entire video, i just want to check that its there. MovieClipLoader has onLoadError and onLoadStart, which works because I can unload the MovieClip right after its starts loading and know its there and if there's a load error I know it's not there. Should work, but I need to run that x number of times to check for the other videos. What would be the best way to do that? Or if you know of another method entirely, that would be even better!

Thanks!

A: 

Without server-side assistance, the method you are already using is probably the ideal solution to check the existence of files without loading the entire file (it will load few KB before cancelling it).

I would be more inclined to use a server-side script like asp.net or php. Checking of files could be achieved relatively easily with that. The script would return a true or false as the result of the file exists check.

This links gives you more details on how to use loadvars to get data from a PHP script. You can use it to create a php script that performs the file check.

http://flash-creations.com/notes/servercomm_loadvars.php

Sivakanesh