Flex Mobile - 打开资产中包含的文件

时间:2011-08-16 15:04:35

标签: flex air

我无法在我的flex移动应用程序的assets文件夹中打开文件,我们将非常感谢您的帮助。

var myFile:File = File.applicationStorageDirectory. ("@Embed('assets/file.txt')");
var myFileStream:FileStream = new FileStream();
myFileStream.addEventListener(Event.COMPLETE, glossaryFileOpened);
myFileStream.open(myFile, FileMode.READ);

1 个答案:

答案 0 :(得分:0)

修好了。

[Embed(source="assets/file.html", mimeType="application/octet-stream")]  
private var TextClass : Class;   
var getFile:String = new TextClass; 
StyleableTextField(TextArea.textDisplay).htmlText += getFile;