Looking at a folders content

This may seem weird but I think it’s possible. Is there a way that flash can look and see if there is a file present in a folder? It’s almost like saying, "loadMovie(“http://your.com/1.jpg”). Flash will go and see if 1.jpg is present at your.com. If it is present, flash will load the movie. If it is not, flash will kick up an error. I would like to be able to put this concept into an “if function”.

if(1.jpg is present){
trace (“show that photo”)
}else if(1.jpg is not present){
trace (“No photo to be shown”)

This is what flash would basically do if you set it up right. It would show the photo if it was there, and would not show it if it is not there. I would like to make more functionality out of this statement. Can this be done?

:rock:

Hi,

Well, is not that Flash can “see” the contents of a folder, but can “not find” a non-existing file in the folder.

So you could try to load your jpg and set a time interval of let’s say 250 milliseconds (a quarter of a second ) that , when completed, checks the bytes loaded. If the bytes loaded equals 0 (zero) it should mean that the file doesn’t exist.

Hope it helps

SHO

Use the LoadVars object. There’s a thread about that in the Best of Kirupa.com.