Groups | Blog | Home
all groups > flash (macromedia) > march 2004 >

flash (macromedia) : Check File Existance


Mau.Net
3/12/2004 11:13:10 PM
Hi there !
We have an application to open a file on event click.
However, if the file doesn?t exists , we want to opejn a defualt file instead.
I ?d like to know if anyone have any tips on how to check if a file exists on
a directory.

Thanks in advance,

Mau

urami_
3/13/2004 8:11:58 AM

[quoted text, click to view]

flash can't do it directly but there is of course way to work it around.
(example file something.jpg)

myFile = "something.jpg";
// Put the name of file and path
FindFile = function (success) { trace(success);delete myVars;};
myVars = new LoadVars();
myVars.load(myFile);
myVars.onLoad = FindFile;

You could use if else to compare files names and do whatever action is that you wish.


--



Regards


urami_*

<hol>
http://flashfugitive.com/
</hol>

Mau.Net
3/13/2004 4:40:51 PM
THANK YOU VERY MUCH !!!
it just did work for our needs !


Regards ,

AddThis Social Bookmark Button