File Exists?

Well, I am stumped. My total lack of programming skills is really beginning to show :frowning:

Anyway, I have some text files (load1.txt, load2.txt, load3.txt, etc…), which reside in the same folder as the main SWF movie on my PC. I want to create a action in a stop frame in the movie to check if one of these files exists, then move to another frame in the movie an play.

(I know this isn’t actual syntax, but I am only trying to show you what I mean)…

If “load3.txt” exists, goto and Play (3);
If “load2.txt” exists, goto and Play (2);
If “load1.txt” exists, goto and Play (1);

You get the idea. I know this can be done, I am just a dummy. :sigh:

Any help would be greatly appreciated.

Regards,
Jason

tutorial: http://www.kirupa.com/developer/mx/multiple_dynamictext.htm

loadText = new loadVars();
loadText.load(“load3.txt”);
loadText.onLoad = function(success) {
if (success) {
//successfully loaded, file exists
//do stuff here like gotoAndPlay(1)
}
else {
//trace(“txt file not loaded properly”);
};
}

maybe you can use a for loop also if the text files are sequential - load3, load2, load1… etc.

hope this helps,
-chris