AS3 - AIR - From a swf path file to a ByteArray

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 04:24:47

问题


I am coding an AIR application.

I've got directly a path of a swf file (because it was stored in a xml file). Do yo know if it is possible to get the ByteArray from this file ?

I know that FileReference do that very well, but this class need a select event. But it isn't my case because I've allready got my path.

Thanks a lot for your answers !


回答1:


In AIR, you can read/write files directly using flash.filesystem.File and flash.filesystem.FileStream.

See, for example, this article.




回答2:


however you can load it with URLStream and get a ByteArray with URLStream.readBytes()



来源:https://stackoverflow.com/questions/5355503/as3-air-from-a-swf-path-file-to-a-bytearray

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!