Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-04-2011, 08:13 PM   #1
Naeuuin
Registered User
 
Join Date: Dec 2010
Posts: 19
Default open and save

How would i go about this?

i want to open a text file from a default directory and read that data into an array.
I want another to save and array into file that they can name into the same default directory
Naeuuin is offline   Reply With Quote
Old 01-04-2011, 08:54 PM   #2
zyxstand
Platinum Member
 
Join Date: Dec 2010
Posts: 193
Default

flash, due to security measures, does not allow writing to files. to load, though, you could use url loader. if you need this project only locally, look into flash air (i believe you can load AND save with it).
zyxstand is offline   Reply With Quote
Old 01-04-2011, 09:04 PM   #3
Naeuuin
Registered User
 
Join Date: Dec 2010
Posts: 19
Default i was directed to air

so im working on a project in flash cs5 and gotten to the point where im adding the open and save feature. i was told flash doesn't but air does. I can still work the same way i have been but in publish i chose air?
now to my original question



i want to open a text file from a default directory and read that data into an array.
I want another to save and array into file that they can name into the same default directory

How would i go about this?
Naeuuin is offline   Reply With Quote
Old 01-04-2011, 09:44 PM   #4
Naeuuin
Registered User
 
Join Date: Dec 2010
Posts: 19
Default

is it the same programming just different when you test / publish?
the adobe Air forum here looks like its not very active.
Naeuuin is offline   Reply With Quote
Old 01-19-2011, 06:37 PM   #5
SDragon029
Determined Coder
 
Join Date: Nov 2010
Location: Ontario, Canada
Posts: 161
Send a message via MSN to SDragon029 Send a message via Skype™ to SDragon029
Default

You should be able to work in the same file and use some functions for opening and saving with Air if you change your Player in the Publish Settings from Flash Player to Adobe Air. To do this you can click on the gray area around the stage or the stage itself then go to the properties of that. From there you click the button labeled "Edit..." under Profile. Then under the "Flash" tab you change "Player" from say Flash Player 10 to be Adobe Air 2.

Now once all that is accomplished your going to want to look into File, URLRequest, URLLoader, and Event.COMPLETE for reading a text file into an array. For saving a file your going to want to look into File, and FileStream for writing a file to disk. If you can't figure it out on your own just let me know and I can provide some more detail on how to work with those.

Good luck,
Tim
SDragon029 is offline   Reply With Quote
Old 01-21-2011, 11:23 PM   #6
Admiral Brodnack
Registered User
 
Join Date: Sep 2008
Posts: 3
Default

You can save and load files in Flash Player using the FileReference class. You don't have much programmatic control, though, so you can't direct the user to a standard directory. Flash opens a save or load dialog.

In AIR you have more control and can open the dialogs already pointing to the desired directory.
Admiral Brodnack 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 04:33 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.