flex读取文本并展示文本内容信息
flex读取文本并显示文本内容信息
flex读取文本并显示文本内容信息
GridDemo.mxml 为要读入的文本信息,中文没有乱码,如果是xx.txt 则会出现中文乱码。
参考自 http://www.cnblogs.com/taobataoma/archive/2008/01/13/1037021.html
flex读取文本并显示文本内容信息
package components { import flash.utils.ByteArray; [Embed(source="GridDemo.mxml", mimeType="application/octet-stream")] public class foobar extends ByteArray { } }
GridDemo.mxml 为要读入的文本信息,中文没有乱码,如果是xx.txt 则会出现中文乱码。
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()"> <mx:Script> <![CDATA[ import components.foobar; [Bindable] public var myText:foobar = new foobar(); public function init():void { trace(myText.toString()); } ]]> </mx:Script> <mx:TextArea width="500" height="500" text="{myText.toString()}"/> </mx:Application>
参考自 http://www.cnblogs.com/taobataoma/archive/2008/01/13/1037021.html