Flex文件读取报错示例
程序员文章站
2022-03-21 22:39:31
flex文件读取 1、s:windowedapplication 复制代码 代码如下:
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");
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");