11/13/2010 12:23:54 PM
Title:
I am getting Error #1014 when using File class
Hi All,
I have wrote a simple flex application in mxml. My code is below:
<?xml version="1.0"?>
<!-- mxml\HellowWorld.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.HTTPStatusEvent;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.events.SecurityErrorEvent;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.net.URLRequestMethod;
import flash.utils.ByteArray;
public function buttonIsClicked():void {
try{
browseFiles();
}
catch(err:Error){txtMsg.text = "error: " + err.message;}
}
public function browseFiles():void
{
var fileToUpload:File = new File(); //This line throws error #1014
}
]]></mx:Script>
<mx:Panel title="My Application"
paddingTop="10"
paddingBottom="10"
paddingLeft="10"
paddingRight="10"
>
<mx:Label id="txtMsg" text="Hello World!" fontWeight="bold" fontSize="24"/>
<mx:Button id="b1" label="Attach file"
click="buttonIsClicked();"
x="105"
y="115"
/>
</mx:Panel>
</mx:Application>
I compile my code using amxmlc command and open the generated swf file in a browser. When I click button and I instantiate File class object, it gives error.
Can anyone help me about how to resolve it ?
Thanks & regards,
Nadeeem
11/14/2010 10:09:56 AM
its a verify file means that something cannot be found. You should use the debug version of flash player to get detailed description of the error.