# File Exists?

**URL:** <https://forum.kirupa.com/t/file-exists/119182>\
**Category:** Uncategorized\
**Created:** [August 12, 2004, 5:29am UTC](https://forum.kirupa.com/t/file-exists/119182 "2004-08-12T05:29:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdilworth](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jdilworth](https://forum.kirupa.com/u/jdilworth)\
**Post date:** [August 12, 2004, 5:29am UTC](https://forum.kirupa.com/t/file-exists/119182/1 "2004-08-12T05:29:46Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![cmd](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cmd](https://forum.kirupa.com/u/cmd)\
**Post date:** [August 12, 2004, 5:45am UTC](https://forum.kirupa.com/t/file-exists/119182/2 "2004-08-12T05:45:48Z")

</div>

> [@jdilworth](#):
>
> Well, I am stumped. My total lack of programming skills is really beginning to show ☹
> 
> 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](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
