-1

I want to create a cms full flash website for that I must make my flash connect to the database. how to make adobe flash connect to the database?

1 Answer 1

1

You should post this kind of questions on stackoverflow, I hope someone more experienced than me can move it there later. So you can create a PHP (or whatever) script that serves you data in XML or JSON. So later you can parse it inside your Flash application:

XML:

<gallery>
<image name="school">image1.jpg</image>
<image name="garden">image2.jpg</image>
<image name="shop">image3.jpg</image>
</gallery>

+AS3 code

var myXML:XML = new XML();
myXML.ignoreWhite=true;

myXML.onLoad = function(success){

if (success)
{
   trace (myXML.firstChild.childNodes[0].attributes.title);
}

myXML.load("gallery.xml");

or JSON:

[
    {
        "food": [
            {
                "name": "pasta",
                "price": 14.50,
                "quantity": 20
            },
            {
                "name": "soup",
                "price": 6.50,
                "quantity": 4
            }
        ]
    },
    {
        "food": [
            {
                "name": "salad",
                "price": 2.50,
                "quantity": 3
            },
            {
                "name": "pizza",
                "price": 4.50,
                "quantity": 2
            }
        ]
    }
]

+AS3 code:

var foods:Array = JSON.decode(jsonstring);

JSON credtis to: https://stackoverflow.com/questions/1713479/as3-json-parsing

1
  • 1
    Actually, this type of question shouldn't even be posted to stackoverflow - it shows no research effort, no detail of the requirements or where the OP is stuck or what the environment is. It is effectively "not a real question" as it is too vague and should be closed rather than migrated.
    – Paul
    May 27, 2012 at 11:14

Not the answer you're looking for? Browse other questions tagged .