Getting Flash to read information from MySql

Posted on 2006-04-02
Last Modified: 2010-04-03
I currently use Flash MX 2004 and wondered if anyone could point me in the right direction of a good resource for Getting Flash to take information from a MySql Database.

Basically I am creating a game that consists of rooms.  I could fairly easily create each individual rooms in flash with all the various objects/monsters/etc in the room, but I would prefer for to be able to store all the information about the rooms in a database, so when a person enters the room, it loads up this information.  Is this possible? and how difficult is it?

Thanks in advance.

Question by:Expressions
    LVL 14

    Assisted Solution

    This is possible but would be somewhat difficult. My suggestion is to have Flash call a PHP page that would read from the mysql server the data and then return it to flash in xml format. This is better because the data is neatly formatted in xml making it easy for flash to parse. Now the only concern would probably be how to store the data as well as how the xml format should be. After that comes the grunt work of creating the PHP page and then the getting flash to do the right thing after getting the xml data.

    LVL 9

    Accepted Solution

    I recommend you to take a look at this web-site:
    AMFPHP is open-source engine that makes it hell easier to communicate with mysql database, becase you don't have to wrap all the query results into xml to have it unwrap right after it reaches your flash application. This engine enables you directly recieve results from db and even use it as input to flash data-aware components...  Samples and tutorials included... easy to use. Take a look.

    ( Answer to your question: yes it's possible to do that... and with amfphp, communication with db will not be flash specific task.. so it's enough if you have some experience with mysql db. Processing recieved data in flash , that's another thing... :o)
    LVL 2

    Author Comment

    Ill have a look and tell you how I get on.
    LVL 2

    Author Comment

    Opps I thought I had answered this.


    I will split the points but give more to ivan_os as his gave more information.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now