A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Flash and databases

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    143

    Flash and databases

    Hello,

    Can anyone point me in the right direction for connecting flash to a database.
    I come from an asp/mysql background....and am wondering if you can use Microsoft access or does flash have a dedicated database for it??


    any help on this topic would be very appreciated.

    Thanks
    Kaan

  2. #2
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588

    ASP+Access equals perfect

    You can easily use asp and access database to talk to flash. What is it you want to do with it?

    I've played around with this loads.....once ya get yer head around it, it's very simple.....As you already know asp it'll be a doddle!!

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    143
    hi, what I what to be able to write n read from a database. Read text from db and it into flash as text or to be able to write to a database from a text box in flash.

  4. #4
    Senior Member Ex-Ess's Avatar
    Join Date
    Nov 2002
    Location
    York (England)
    Posts
    588
    To Read From Database:
    Create your ASP script as you normally would to read the details from your DB. Instead of creating the page using HTML and stuff just assign the data from the db to variables, eg..

    userName = rs.Fields("userName").Value
    password = rs.Fields("userName").Value

    once you know this page works without flash move on...

    In the flash file (before you need the info from the DB) use loadVariables("nameOfASPPage.asp");

    That line opens the ASP file and runs the script and recieves the variables defined within it.

    After that you will be able to call userName or password from the root of the movie you put the loadVariables function.

    I suggest that in the ASP file you put a loaded=true variable right at the bottom. Then in Flash do a frame loop until loaded == "true". That way you can be sure all your variables are loaded before continuing (took me ages to figure that one out!)


    To write to the DB you would do exactly the same but the variables are created in Flash and you use:
    loadVariables("nameOfASPPage.asp","","POST");

    Then in the ASP file you would use Request("variable")



    Any more help you need let me know.

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