dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Saving array to a text file? Help!

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jul 2007
    Posts
    9

    Saving array to a text file? Help!

    I've just finished a Flash project that collects data throughout its runtime and stores it all in an array. My question is how I can access that information. I've spent hours today trying to figure out how to save it to a text file, but I don't think it's possible (is it?). I've seen people talking about back ending with PHP (or something like that?). The thing is that I'm pretty far at the beginner stage of programming (started three weeks ago), and I have no idea what that means or how to do it. So would someone mind explaining to me how I can access the text in this array? Thanks!

  2. #2
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    I used Shared Objects for exactly that purpose in AS2. They're essentially Flash cookies.

    I haven't tried them yet in AS3, but they should be pretty straight-forward:
    http://livedocs.adobe.com/flash/9.0/...fV3/index.html

    PHP is a scripting language that interfaces really easily with mySQL (a database). So if you need to store user data on your server, you'll be using ActionScript, PHP, and mySQL in conjunction with one another. This class is helpful for that task:
    http://sephiroth.it/test/unserializer/

    There are thousands of PHP-mySQL tutorials online that will point you in the right direction if you decide you need to store this data on your website (as opposed to on the user's machine). We can help you with the PHP/ActionScript interface if that gives you trouble.

    Good luck!

  3. #3
    Junior Member
    Join Date
    Jul 2007
    Posts
    9
    Thanks for responding. I've looked at that, but I can't figure out where the data is stored to. How can I read it in a text file?
    Thanks!

  4. #4
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    It is stored in the Application Support section of your user folder by the Flash player.

    You cannot access the harddrive directly from a Flash applet. (You can from an Apollo app though, if that is a direction you are interested in heading).

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    9
    I'm sorry, but you just went past my Flash vocabulary level. What's an applet? And where is the Application Support section? And what does it mean that I can't access the hard drive directly from a Flash applet?
    Sorry to be so confused. Thanks!

  6. #6
    Multitouch Aficionado
    Join Date
    Mar 2006
    Posts
    275
    If you want to access a user's harddrive from a website, that won't happen. Flash doesn't allow it for security reasons.

    Apollo (aka AIR) is a tool on Adobe Labs that will allow you to build computer programs with Flash. If you use that toolkit, you can access the harddrive.


    The Application Support file is in the user's Library on Mac. In XP, it's at ~/Application Data/. In Vista, it's called AppData (also in the user folder).

    In the Application Support folder, you can find the Shared Objects at ./Macromedia/Flash Player/#SharedObjects. Note, this is entirely unneccessary information. If you are just trying to save an Array to the hard drive, just use the Shared Object, and don't worry about where Flash hides it. =)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center