flex_从文件加载数据;
结果输出:
=>File_Data:I Love You,Baby!我好想好想你哦!
=>File Was successfully Loaded;
=>Loaded(33) of (33) bytes;
=>Loaded(0) of (33) bytes;
=>FileReferenceLoadExample package com.learn.mix ? ? ? ? ? ?var result:String = data.readMultiByte(data.length,"gb2312"); =>app.mxml <?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" ?? ??? ??? ??? xmlns:s="library://ns.adobe.com/flex/spark" ?? ??? ??? ??? xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" ?? ??? ??? ??? pageTitle="TheStudioOfCenyebao" creationComplete="creationCompleteHandler(event)"> ?? ?<fx:Script> ?? ??? ?<![CDATA[ ?? ??? ??? ?import com.learn.mix.FileReferenceLoadExample; ?? ??? ??? ? ?? ??? ??? ?import mx.events.FlexEvent; ?? ??? ??? ? ?? ??? ??? ?private var fileRef:FileReferenceLoadExample; ?? ??? ??? ? ?? ??? ??? ?protected function creationCompleteHandler(event:FlexEvent):void ?? ??? ??? ?{ ?? ??? ??? ??? ? ?? ??? ??? ?} ?? ??? ??? ? ?? ??? ??? ?protected function btn_clickHandler(event:MouseEvent):void ?? ??? ??? ?{ ?? ??? ??? ??? ?fileRef = new FileReferenceLoadExample(); ?? ??? ??? ??? ?addElement(fileRef); ?? ??? ??? ?} ?? ??? ??? ? ?? ??? ?]]> ?? ?</fx:Script> ?? ? ?? ?<s:VGroup width="450" height="230" verticalCenter="0" horizontalCenter="0" horizontalAlign="center" verticalAlign="middle"> ?? ??? ?<s:Button label="加载数据" click="btn_clickHandler(event)"/> ?? ?</s:VGroup> </s:Application> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |