Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-14-2012, 07:16 AM   #1
aktell
FLEX Jokey
 
aktell's Avatar
 
Join Date: Jun 2007
Location: New Zealand
Posts: 154
Default File pathway to include into

Hi there,

Could anybody please give me an idea of how to go about to read from a text Box (inputTwo) the required pathway as (fileName = myDirectory/myTextFile.txt) into the AS portion of this code.

Code:
private var fileName:String = new String(inputTwo.text);		

private function createFile(fileName:String):void {
				
var file:File = File.desktopDirectory.resolvePath("fileName");

}
Thanks in advance regards aktell
aktell is offline   Reply With Quote
Old 05-14-2012, 02:30 PM   #2
solisarg
Senior Member
 
solisarg's Avatar
 
Join Date: Mar 2003
Location: Buenos Aires, Argentina
Posts: 496
Default

If the user writes the name of a file, and using something like this:

var file:File = File.desktopDirectory.resolvePath(fileName);

Note I don't use quotes for the argument, you get a File reference if the file exists in the user desktop (desktop will vary with OS), if the file is not there, you get a null reference
I assume you're working on AIR or Flash Projector

Jorge
solisarg is offline   Reply With Quote
Old 05-14-2012, 09:09 PM   #3
aktell
FLEX Jokey
 
aktell's Avatar
 
Join Date: Jun 2007
Location: New Zealand
Posts: 154
Default

Ola Jorge,
Thanks I was able to work it out, but will try it also your way ! thanks again regards aktell
aktell 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


All times are GMT. The time now is 02:58 AM.

///
Follow actionscriptorg on Twitter

 


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