browserForOpenMultiple - 崩溃
我正在尝试使用 Flex sdk 3.5 内的 browserForOpenMultiple 函数,我正在尝试找出一个错误。 browserForOpenMultiple 不会每次都崩溃,但似乎我可以上传一次文件,但是当我去上传第二个文件时,调用 browserForOpenMultiple 函数时它会崩溃。有人对可能的原因有任何想法吗?
更新:
private function browseForFiles():void
{
fileBrowser = new File();
fileBrowser.addEventListener(FileListEvent.SELECT_MULTIPLE, filesSelected);
fileBrowser.addEventListener(Event.CANCEL, fileSelectionCancelled);
fileBrowser.browseForOpenMultiple("Select Desired Media File(s)", [(mode == "Media")? MediaTypes.getFileFilter() : MediaTypes.getVideoFilter()]);
}
I am trying to work with browseForOpenMultiple function inside Flex, sdk 3.5, I am trying to figure out a bug. The browseForOpenMultiple does not crash everytime, but it seems as though I can upload a file once, but when I go to upload a second file, it crashes when the browseForOpenMultiple function is called. Anyone have any ideas about possible causes?
Update:
private function browseForFiles():void
{
fileBrowser = new File();
fileBrowser.addEventListener(FileListEvent.SELECT_MULTIPLE, filesSelected);
fileBrowser.addEventListener(Event.CANCEL, fileSelectionCancelled);
fileBrowser.browseForOpenMultiple("Select Desired Media File(s)", [(mode == "Media")? MediaTypes.getFileFilter() : MediaTypes.getVideoFilter()]);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
因此,当数组中列出了超过 60 个项目并转换为 FileFilter 的字符串时,文件扩展名数组中的代码就会崩溃。这可能不是 Adobe 的限制,但我想提一下,崩溃已修复,以便其他可能遇到 browserForOpenMultiple 问题的人知道这个问题是什么。这不是我最初编写的代码,因此我将检查它以获取更多线索,但目前,太多的数组项被连接到 FileFilter 对象的字符串中导致了崩溃。
So the code in our array of file extensions was crashing when there were over 60 items listed in an array that gets converted into a string for the FileFilter. This may not be an Adobe limit, but I wanted to make mention that the crash is fixed, so that others who may be encountering issues with browseForOpenMultiple will know what the issue was for this problem. This is not code that I originally wrote, so I will check into it for more clues, but for the time being, too many array items being joined together into a string for FileFilter object caused the crash.
这可能是它构建文件的方式,而没有真正的文件引用。
尝试这样的事情:
It could be how it's construct the File, without a real file reference.
Try something like this :