ios - 在 ActionScript Moblie iOS 应用程序中读取文本文件

标签 ios actionscript-3

我正在尝试从 ActionScript Mobile 项目中的文本文件中读取文字。然后将每个 Word 存储在一个数组中。这在 AIR IOS 模拟器中工作正常,但现在我在 Ipad 上调试并且它不工作......

错误 #2044:未处理的 ioError:。 text=Error #2032:流错误。网址:app:/var/mobile/Applications/13FB44C5-E2EB-421F-9EF8-CB1290B75DD8/Library/Application%20Support/com.mcmami3.word/Local%20Store/media/words5.txt

private function slangLoadedThree(event:Object):void {

        slangContentThree = event.target.data;
        slangArrayThree= slangContentThree.split("\n");

    }



//five letter load
            var xmlFileFive:File=new File(File.applicationStorageDirectory.nativePath).resolvePath("media/words5.txt");
            myLoaderThree.load(new URLRequest(xmlFileFive.nativePath));
            myLoader.addEventListener(AsyncErrorEvent.ASYNC_ERROR, errorHandlerAsyncErrorEvent);
            myLoader.addEventListener(IOErrorEvent.IO_ERROR, errorHandlerIOErrorEvent);
            myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorHandlerSecurityErrorEvent);
            myLoaderThree.addEventListener(Event.COMPLETE, slangLoadedThree);

最佳答案

如果只有一个文件,您可以像嵌入图像一样嵌入 txt 文件。有关如何在此处找到的说明:

Flex3: Load contents of an embedded text file into a variable

或在这里:

How do I embed static text in actionscript 3?

关于ios - 在 ActionScript Moblie iOS 应用程序中读取文本文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16322545/

相关文章:

ios - PBXCp 错误.. Storyboard : No such file or directory

ios - 如何将 barButtonItems 从子 Controller 放入 navItem?

actionscript-3 - Red5 服务器仅记录来自 AIR 的 RTMP 视频馈送的前几秒

php - 为什么 ActionScript 转 PHP 有时插入查询和 cURL 失败?

actionscript-3 - 如何在数据生成模式下使用 NetStream 循环播放视频

iOS:信标检测需要很长时间

ios - Core Data 可转换 NSArray of IDs

actionscript-3 - 嵌入欧美字符

apache-flex - 大图片加载问题

java - xcodebuild 打印了太多日志