Frage

Is there a way to add an event listener to the copyTo() function so I can run code once the action is complete?

Below is my code and that last line is what I would assume might work, but it doesn't.

var sourceDir:File = File.applicationDirectory.resolvePath("userSettings.xml");
var resultDir:File = File.applicationStorageDirectory.resolvePath("userSettings.xml");
sourceDir.copyTo(resultDir, true);

// Is this possible?                
sourceDir.addEventListener(Event.COMPLETE, fileCopied);
War es hilfreich?

Lösung

According to DOCUMENTATION no, but copyToAsync() function is dispatching Event.COMPLETE.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top