gukit
01.11.2008, 18:19
Проверка существования файла. Если запускаю из под Flash(Ctrl+Enter) скрипт правильно проверяет наличие и выдает "file exist". Когда экспортирую в swf, то получается "file not exist". Ничего не понимаю. Что не так? Какие настройки надо сделать?
fileExists=new LoadVars();
fileExists._parent=this;
fileExists.onLoad=function(success)
{
//success is true if the file exists, false if it doesnt
if(success)
{ mx.controls.Alert.show("File exist");
}
else {mx.controls.Alert.show("File not exist"); }
}
fileExists.load("http://localhost/test.txt") //initiate the test
fileExists=new LoadVars();
fileExists._parent=this;
fileExists.onLoad=function(success)
{
//success is true if the file exists, false if it doesnt
if(success)
{ mx.controls.Alert.show("File exist");
}
else {mx.controls.Alert.show("File not exist"); }
}
fileExists.load("http://localhost/test.txt") //initiate the test