Hi All,
I have a recursive call which includes an asyn operation (file copy) ..
I want to find out when the recursive call finishes (along with all asyn operations).
private function copyInto(directoryToCopy:File, locationCopyingTo:File):void
{
var directory:Array = directoryToCopy.getDirectoryListing();
//get list of files in dir
for each (var f:File in directory)
{
if (f.isDirectory)
copyInto(f, locationCopyingTo.resolvePath(f.name));
else
{
f.copyToAsyn(locationCopyingTo.resolvePath(f.name), true);
f.addEventListener(Event.COMPLETE, onFilecopied);
}
}
}
function onFileCopied(event){
alert(event.target); // [object File]
}
Basically what I needed was to copy a folder structure to another drive,and the folder
being copied contains some files that are 100-200MB and which take time to copy,which
blanks out the UI and the flash player.
And after the files get copied, I want to do further things(hopefully without
blocking the UI).
Any help?
Thanks All .