Ah, you're right Ian. My post wasn't really a reply to your sollution,
the topic "File Exists - a better way" just triggered a memory to the
code I posted. I just wanted to contribute a bit to the original topic
(it was a long, tiresome day).

But perhaps it might be useful in some other way? For example if you'd
like to preload/cache a few files when your application starts that
can be used later on...

Oh well, sorry for the noise.
Bart

2006/3/18, Ian Thomas <[EMAIL PROTECTED]>:
> Bart,
>   Firstly, I'm not sure why that's a reply to my posting - and
> secondly, why would you want to do that..?
>
>   The original poster asked if there was a way of checking whether a
> file exists sooner than waiting for the whole file to load. Your
> solution loads the whole file via LoadVars - which would take the same
> amount of time as loading it normally. My solution is a quick call to
> a webserver and a few bytes worth of response - much quicker than
> (say) loading a 250Kb file...
>
> Ian
>
> On 3/18/06, Bart Wttewaall <[EMAIL PROTECTED]> wrote:
> > 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.");
> > }
> >
> >
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> 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
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to