XML Database?

3 posts

Flag Post

Sorry guys, I’m 100% new to flash programming. I finally have gotten the hang of some of the basics.

What I want to do now is link one scene to a database. Lets say I had a database of people in history and when come to that scene it would load the names of them in order. When someone clicked on one of them it would take them to a different scene.

This way I could update the game by making changes to the XML file. But when it compiles the .fla file into a .swf file it doesn’t include the XML file, does it? And kongregate only allows you to upload a .swf file, correct?

Maybe I’m confused by all of this – if someone understands what I’m talking about please help sort me out. Basically, I want to have a static database or tree structure in my game for data organization and I have no idea how to go about this. Is there a better idea than using xml?

 
Flag Post

your confusing two things, an XML file is not a database.

connecting to a database is a bit complicated as flash doesn’t have the ability to communicate directly w/ a database, for that you need some server side application, the simplest way to do that is by using ASP or PHP.

the easier thing to do, as you said, is to use an XML file.

if i’m not mistaken kong allows you to upload more then one file but i’m not sore if and how you can edit it later.

you can also host the xml file on a diffrent server and specify the full path when you load it, all you need to do then is to change the security configurations in your flash file to allow connection to your domain, do that by entering this code in your flash:

system.security.allowDomain("<yourHostDomain>")
 
Flag Post

Thanks, that was helpful. I think I’m over complicating it.

All I really want, is some global database structure I can create and use in my .swf file. I guess even if I could use recordsets I could kind of mash a simple database together myself. I just want some of the pages loading dynamic text (randomly in some parts). Any advice on the best way to do this?