0
votes

I'm using this feature http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html#createDirectory%28%29

Is it possible to check if directory was created successfuly.

createDirectory.addEventListener(Event.COMPLETE, complete);
createDirectory.createDirectory();

This code doesn't fire complete function.

Thank you.

1

1 Answers

2
votes

Creation of directory is synchronous operation so it will not fire the event COMPLETE. If the line pass the directory will be created. But the better way is to use try catch block to catch the exception (IOError and SecurityEror ) if the creation of the directory fail. The Event complete are fired only for asynchronous operations.