dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Stumped.. Can a database be linked to show information?

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    1
    Greetings...

    My employer would like to create a Flash that would be able be take information given by an individual (they fill in a field with a school name & USD, etc.) and the flash would be able to grab the information from a database and extrapulate it into a Flash for that school. This would show pie charts of percentages of students vs. State data, etc.

    Is this possible? If so how? I'm running out of time and patience trying to find this answer.

    Thanks!

    Cheryl
    pixle

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Posts
    316
    i havent done this myself, but this is very possible. you can use coldfusion which works great with flash, or you can use php scripts to connect to something like an oracal database and return vars to the flash movie. i would search on macromedia.com for database connectivity with flash. and research coldfusion also.

  3. #3
    Member
    Join Date
    Nov 2001
    Posts
    55
    Actually, you can use Cold Fusion, ASP, PHP - it does not matter. I use ASP together with XML. The concept is following:
    1) In Flash create a XML object to hold the data which will be sent to the server:

    function xmlOut (param) {
    xmlOutput = new XML();
    eleRoot = xmlOutput.createElement("root");
    eleRoot.attributes.eleParam = param;
    xmlOutput.appendChild(eleRoot);

    (in this case we are sending only one variable as a xml attribute param. But you can send as much information as you like - just add more xml elements, attributes etc.)

    You call this function whenever you need to send data to server.

    2) Create an ASP or PHP or... page, which takes the parameter, sends it to database server, receives the results and sends results as new XML document to Flash.
    If you do not know, how to do this, go to some ASP, PHP, Cold Fusion forum for help. Also you have to know how to make requests to database, which depends on database system you are (will be) using.

    3) In Flash create another XML object to receive data:
    function loadXMLdoc () {
    myXML = new XML();
    myXML.onLoad = convertXML;
    myXML.load("yourdynamicpage.*");
    }

    Once loaded, you can go through the nodes and read data.



  4. #4
    Originally posted by trikenit
    i havent done this myself, but this is very possible. you can use coldfusion which works great with flash, or you can use php scripts to connect to something like an oracal database and return vars to the flash movie. i would search on macromedia.com for database connectivity with flash. and research coldfusion also.
    There is a very easy way to send test into a flash file all you need to do is put a querystring on the end like a php or perl file.

    When you create a querystring with different variables they are automatically passed into flash. myfile.swf?Message=Hello World&Name=My Name

    All you need to do is create a dynamic text field that will take on the variables value. just make sure there are no % or a few other special characters that cannot be entered through the querystring.

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