header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Nadeem Ullah
Points:0
Posts:0

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



1
Brig
Points: 0
Posts:0
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.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 7+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions