# Check if file exists

**URL:** <https://forum.kirupa.com/t/check-if-file-exists/249594>\
**Category:** flash\
**Created:** [January 20, 2008, 5:33pm UTC](https://forum.kirupa.com/t/check-if-file-exists/249594 "2008-01-20T17:33:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adamius](https://avatars.discourse-cdn.com/v4/letter/a/6f9a4e/32.png) [@Adamius](https://forum.kirupa.com/u/Adamius)\
**Post date:** [January 20, 2008, 5:33pm UTC](https://forum.kirupa.com/t/check-if-file-exists/249594/1 "2008-01-20T17:33:47Z")

</div>

i’m trying to find a way to get flash to find if a file exists inside a folder, if so play it, if not cycle to the next possible file name and try again. so far i’ve used a try/catch statement and loadVars and an onLoad function statement but the first doesn’t work and the load vars comes up with an infinate loop and flash terminates it. if anyone has any ideas i’d be VERY greatfull  
thanks  
ads
