Ian: "There's no Flash native hack as far as I know."
You can check (and cache while you're at it) any file by using LoadVars:
var file:String = "anyFileType.exe";
var fileExists:LoadVars = new LoadVars();
fileExists.onLoad = mx.utils.Delegate.create(this, doCheck);
fileExists.load(file);
function doCheck(success:Boolean) {
if (success) trace("File "+file+" exists.");
else trace("File "+file+" does not exist.");
}
2006/3/18, Isaac Rivera <[EMAIL PROTECTED]>:
> I backtracked on this thread...
>
> I guess the questions are:
>
> 1) what are you trying to load?
>
> 2) what onLoad(success:Boolean) are you using?
>
> Are you using the XML or LoadVars?
>
> Assuming you are using the LoadVars, a more reasonable "timeout"
> approach would be something like:
>
> //-------------------- code --------------------------
> function fileExists() {}
> function fileDoesNotExist() {}
>
> var timeout:Number = 10000; // 10 seconds...
> var app:MovieClip = this;
>
> var lv:LoadVars = new LoadVars();
> lv.onLoad = function(success:Boolean) {
> clearInterval(app.interval);
> if (!success) {
> app.fileDoesNotExist();
> } else {
> app.fileExists();
> }
> };
>
> var startTime:Number = getTimer() + timeout;
> lv.load(url);
>
> var interval:Number = setInterval(function () {
> var total:Number = app.lv.getBytesTotal();
> if (total > 4) {
> clearInterval(app.interval);
> app.fileExists();
> } else {
> if (getTimer() >= app.startTime) {
> clearInterval(app.interval);
> app.fileDoesNotExist();
> }
> }
> }, 25);
>
> //-------------------- code --------------------------
>
>
> On Mar 17, 2006, at 10:31 AM, Yotam Laufer wrote:
>
> > [Theres no "reasonable" amount of time on networked connections of
> > unknown hardware specs...]
> >
> > And yet timeout times are set somehow... I think it's a subjective
> > decision.
> > I wouldn't do it like this, but if someone has to?
> >
> > Yotam.
> > _______________________________________________
> > [email protected]
> > To change your subscription options or search the archive:
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >
> > Brought to you by Fig Leaf Software
> > Premier Authorized Adobe Consulting and Training
> > http://www.figleaf.com
> > http://training.figleaf.com
>
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com