这可能有点哈克,但关于使用什么getDirectoryListingAsync()?您可以创建一个临时文件对象,指向所需文件所在的目录。当调用异步处理程序时,可以遍历结果,直到找到与目标匹配的文件,然后进行日期检查。类似这样的:
var expectedName:String = "myFile";
var oldModificationDate:Date=new Date();
public function fileCheck(fileName:String)
{
File file = new File(fileName);
File dir = new File("/somefiles/localDir/");
dir.getDirectoryListingAsync();
dir.addEventListener(FileListEvent.DIRECTORY_LISTING, directoryListingHandler);
}
function directoryListingHandler(event:FileListEvent):void {
var list:Array = event.files;
for (var i:uint = 0; i < list.length; i++) {
if(list[i].name==expectedName && f.modificationDate.getTime() > oldModificationDate)
{
fileFoundHandler();
}
}
}
function fileFoundHandler():void
{
//your response code goes here
}
如果针对Flash 11.4,则可以使用'actionscript worker',它本质上是一个单独的线程。 – BadFeelingAboutThis
感谢您的指点,但我们的版本中没有工人。 – Paull
这是通过Adobe Air吗? – BadFeelingAboutThis