dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Saving and retrieving variables from Flash<->Database

  1. #1
    MindGem Graphics Inc. JediMind's Avatar
    Join Date
    Nov 2001
    Location
    Stockholm/Sweden
    Posts
    407

    Saving and retrieving variables from Flash<->Database

    Hey,

    Could someone point me to a tutorial for beginners on how to save/get variables stored on an external file/database into flash?

    As I understand it I need to learn the basics of either MySQL or XML as the database language AND a side server script like PHP or ASP to speak with the database from Flash.

    I can't belive Flash hasn't somehow figure this thing out and made it much much easier to save data.

    Anyways, anyone have an URL for anything that discuss this?

  2. #2
    Lunatic
    Join Date
    Nov 2002
    Location
    AS3 Forum
    Posts
    342
    The reason why flash cannot do that is because it is a client side application (The flash code is executed on the client computer) where as the database you use and the php you use to pull information out of it is executed on the server side. (The code is executed on the server computer).

    Can you specifically explain what you are trying to accomplish so I can steer you in the right direction?

    For instance to send and retrieve stuff from flash using the post method to a php script on your server, here's a basic tutorial:

    http://rickydoesit.com/actionscript-...iables-to-php/

    For the rest, just google "mysql php tutorial database access" or something like that. That will show you how to communicate with a database from PHP.

  3. #3
    MindGem Graphics Inc. JediMind's Avatar
    Join Date
    Nov 2001
    Location
    Stockholm/Sweden
    Posts
    407
    Hi Beathoven.
    I'll check out the links for sure but since you asked me to specify what I wanted I'll go ahead and do that, hoping for a code snippet from you.

    So I have 1 variable in Flash.
    var test:Number = 4;

    When I click a button it'll increase the value by one
    and send the value to a variable container on my database(preferly MySQL) via preferly(PHP)

    So what is the simplest, shortest code snippet in PHP and XML/MySQL to pick that variable post up and get it back to flash on command?

  4. #4
    Senior Member
    Join Date
    Apr 2004
    Location
    LA
    Posts
    349
    You should also check out amfphp.org. That makes things a lot easier if you use PHP.
    Write multiplayer games with FlashMOG 0.3.1
    Try the MyPlan Salary Calculator

  5. #5
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Quote Originally Posted by JediMind View Post
    Hi Beathoven.
    I'll check out the links for sure but since you asked me to specify what I wanted I'll go ahead and do that, hoping for a code snippet from you.

    So I have 1 variable in Flash.
    var test:Number = 4;

    When I click a button it'll increase the value by one
    and send the value to a variable container on my database(preferly MySQL) via preferly(PHP)

    So what is the simplest, shortest code snippet in PHP and XML/MySQL to pick that variable post up and get it back to flash on command?
    It's a bit more complex but basically what you are asking for:
    http://www.flashscript.biz/php/AS3_m...te_counter.php
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

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