Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Desktop, Mobile and non-browser Environments > AIR (Apollo)

Reply
 
Thread Tools Rate Thread Display Modes
Old 03-12-2008, 06:22 PM   #1
halfasleeps
Senior Member
 
Join Date: Mar 2007
Posts: 247
Default help with getting file???

I have this code:

var iconFile:File = File("C:/Documents%20and%20Settings/jisaacks/Desktop/autopro-7.exe");


which produces an error saying: Error #1034: Type Coercion failed: cannot convert "C:/Documents%20and%20Settings/jisaacks/Desktop/autopro-7.exe" to flash.filesystem.File.


I am confused what I am doing wrong. I typed the path into run> and it opened it just fine so I know that path is valid.
__________________
Visite my site: Altoona Design
halfasleeps is offline   Reply With Quote
Old 03-19-2008, 04:29 PM   #2
ABM
Registered User
 
Join Date: Mar 2008
Posts: 15
Default

Hi,

Deed you try it with other files, like jgp, gif etc.. and not.exe??
ABM is offline   Reply With Quote
Old 03-22-2008, 12:13 AM   #3
halfasleeps
Senior Member
 
Join Date: Mar 2007
Posts: 247
Default

Quote:
Originally Posted by ABM View Post
Hi,

Deed you try it with other files, like jgp, gif etc.. and not.exe??
No i didnt try that, I wil try it next time I am in the office and post back thr results.

Thanks!
__________________
Visite my site: Altoona Design
halfasleeps is offline   Reply With Quote
Old 03-24-2008, 02:42 PM   #4
halfasleeps
Senior Member
 
Join Date: Mar 2007
Posts: 247
Default

OK I opened a new Flash CS3 air document and pasted put this in the timeline:

ActionScript Code:
import flash.filesystem.*; function createFile() {     var desktopFile:File = File("file:///C:/Documents%20and%20Settings/jisaacks/Desktop/testfile.txt");     var fileStream:FileStream = new FileStream();     fileStream.open(desktopFile, FileMode.UPDATE);     fileStream.close(); } createFile();

and I get the same error.

but If I use File.desktopDirectory.resolvePath("testfile.txt");
it works and if I then output the file path it is exactly the same as the string I used above.

I dont want to have to use desktopDirectory though because I am trying to make a drag and drop feature, and a user can drag things from any file folder.



THANKS!!!
__________________
Visite my site: Altoona Design
halfasleeps is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash to PHP & PHP to Flash awdio ActionScript 2.0 2 11-08-2006 05:09 PM
how do I make a clip wait before loading? shoodogg1977 ActionScript 1.0 (and below) 4 09-01-2006 02:08 PM
array from external text file loop problems shrinkwrapped ActionScript 2.0 4 07-17-2006 11:59 PM
how to open pdf file from projector file in acrobat reader sohailfx ActionScript 2.0 2 06-24-2005 06:54 PM


All times are GMT. The time now is 09:12 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.