Detecting if a file exits in ActionScript

In Archive by Fredy Ore

A useful tutorial by Guy Watson from Flash Guru on “Detecting if an include file exists”.
http://www.flashguru.co.uk/000310.php

[js] fileExists=new LoadVars();
fileExits._parent=this;
fileExists.onLoad=function(success)
{
//success is true if the file exists, false if it doesnt
if(success)
{
//the file exists
var nm=this._parent.createEmptyMovieClip(“swfHolder”,1); //so create a movieclip
nm.loadMovie(“myfile.swf”); //and load our .swf file into it
}
}
fileExists.load(“myfile.swf”) //initiate the test
[/js]