奥多比空气。检查createDirectory()是否完成
是否可以检查目录是否创建成功。
createDirectory.addEventListener(Event.COMPLETE, complete);
createDirectory.createDirectory();
此代码不会触发完整功能。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目录的创建是同步操作,因此不会触发事件 COMPLETE。如果该行通过,将创建目录。但更好的方法是在目录创建失败时使用 try catch 块来捕获异常( IOError 和 SecurityEror )。
仅当异步操作时才会触发事件完成。
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.