Flex文件读取报错示例
发布时间:2017-01-07 来源:查字典编辑
摘要:Flex文件读取1、s:WindowedApplication复制代码代码如下:importmx.events.FlexEvent;/*初始...
Flex文件读取
1、s:WindowedApplication
复制代码 代码如下:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="initHandler()">
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
/*初始化函数*/
protected function initHandler():void
{
var file:File = new File();
}
]]>
</fx:Script>
<fx:Declarations>
<>
</fx:Declarations>
</s:WindowedApplication>
2、File
复制代码 代码如下:
var file:File = new File(File。applicationDirectory.nativePath+"/test.txt");