Hello,
Is it possible to check if a file exists on the webserver?
I need to dynamically load an image, but if it doesn’t exist it should load another one and so on.
I’ve tried it with URLRequest but that doesn’t do the trick, it keeps returning true whatsoever… it never gets in the “catch”
[AS]private function testImage(str:String):Boolean
{
var bool:Boolean = false;
try
{
var urlreq:URLRequest = new URLRequest(str);
trace("loader -",urlreq.url);
bool = true;
} catch(e:Error) {
trace("error loading", str);
bool = false;
} finally {
trace("--> loader = ",bool);
return bool;
}
}[/AS]
Thx, :pa: