dcsimg
A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: the whole world is mad about XML, why?!?

  1. #1
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194

    the whole world is mad about XML, why?!?

    Hi,

    I've created a simple database program that stores the data in a .txt file. It works well and loads/saves fast. I'm thinking of expanding this program, but whats holding me up is that i'm not sure if I should convert everything over to use XML.

    So my question is, should I do that? what are the advantages over using a .txt file for a database?. Is using XML just a fashion?

    thanks for any advice. (sorry about re posting this!, but I need to start!)

  2. #2
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    They are mad about inbound xml but elusive about outbound

    I love MySQL. Not what you expect the xml mod to say huh? I think it has more available code, examples, free resources and tutorials as they relate to outbound MySQL than if compared against xml. There are many examples of a flash object reading xml but damn few that show written xml, node manipulation and insertion and more at runtime. Usually people able to code it...hold it dear.

    I personally would rather manipulate large data sets...complicated data insertion, advanced filtering, relational queries and much more using the MySQL/PHP model.

  3. #3
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    good points. To be honest im in a state of confusion. To get the info from mySql/php to Flash you need to save it as a .txt file right? otherwise what will flash load in?? it just seems Flash is moving more and more to using XML for data, and like it or not it seems thats the thing i should get into. Is it a major pain in the ass for PHP to write out XML from a mysql database?

    and most importantly (cos ive posted this elsewhere) how do you write out XML from Flash? cos thats what I need to do now.

  4. #4
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Quote Originally Posted by Boombanguk
    good points. To be honest im in a state of confusion. To get the info from mySql/php to Flash you need to save it as a .txt file right? otherwise what will flash load in?? it just seems Flash is moving more and more to using XML for data, and like it or not it seems thats the thing i should get into. Is it a major pain in the ass for PHP to write out XML from a mysql database?

    and most importantly (cos ive posted this elsewhere) how do you write out XML from Flash? cos thats what I need to do now.

    Nope...the php is an intermediary to the database and it either retrieves or inserts the data and then sends what is needed...as variables or arrays of variables....so flash can repurpose that data. XML is fast...but take that example we saw in here recently with an xml file that exceeded 8 megs. Storage size per xml file is an issue whereas using the intermediary (php) we can pick and choose and depending on the database structure...get really creative. Massive data sets are easier to maniuplate(I think) and unlike xml objects...flashplayer will not pause during load like it does populating a large xml object. Everything else takes a back seat but with simple strings of arrays from php we can stream in a massive amount of the same data cranked from a database...or multiple/simulataneous clips doing it...all at the same time and with some creative coding make it seemless to the end user. Coupled with an efficent LoadVars (or more than one)...look out. Load a 6 meg xml and watch everything go freeze dried for a sec or two.

    I'm not saying xml isn't cool. It is. I just think as a person who supports open source code and free exchange of ideas...there is more for the new user to MySQL with flash (inbound and outbound and man that's important!!) than there is with xml and flash. A simple search bears this out in any search engine. Plenty of things that READ it...few that write it.

  5. #5
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    your absolutely right. I just had a quick look for writing XML with Flash, and its a confusing state of affairs. Some ppl say that you have to use a loadVars object to send but a XML object to receive?? and if you have an array of objects say in Flash, but you want that outputted as a XML file, er...do you put the Array of objects first into a XML object inside Flash and then send that to Php for sticking into a .php file, OR do you just use loadVars to send all the data to php for php to format it into a .php file? sorry for any confusion on my end.

    ...and do you know any good tutorials for writing out XML from Flash?

    re the mySql approach, I see what you mean per individual user, but what if I wanted to load in say 200 objects into Flash, wouldn't 200 queries to a MySql database cause problems? rather then loading in a .txt/XML file with 200 entries in it, and then parsing it?

  6. #6
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    also re the mySql, where is the actual database stored? i mean in what format...one of the things I like about my .txt database is that I can back it up each night just by downloading it !

  7. #7
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Want to find a huge amount of people writing php classes and such for xml node manipulation...head to sourceforge. But is any of it stable...free and ready for practical use? You tell me

  8. #8
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Most commercial server space (no...not the bargain basement stuff) includes a mysql database or two. Every host has it's own way of you manipulating it but it's not hidden and they try to make it user friendly. Your host could tell you.

  9. #9
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    Well..no..200 isn't realistic anyway....but I can run a huge stream pretty smoothly while other animation do their thing.

  10. #10
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    thanks, but what I'm confused about is, do you have all the data formated in a XML object inside FLash in other words, you copy over all your data from your array of objects to a XML object, and then do XML.sendandload, or do you just send all teh data with loadVars, and let php turn it into XML when it saves it to the file?

  11. #11
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I have some simple examples of writing xml from POST variables inside flash. I'll dig them out. Simple writing isn't the rub. It's manipulation within the object that requires really advanced XML/php coding which may...line for line...be less efficient than MySQL/php within the scope of that object.

    Lets say I have a database table with four items listed and their associative data (id,name,value,timestamp,ip,whatever) and I have an xml file with four childnodes and their associative data (attributes or such). Pretty much the same data. I want to make the third listing in the MySQL table the first and move the first item to be the third...it takes less coding than if I code a php file to manipulate..rearrange and reinsert into the xml file and write it. Find some...you'll see. MySQL is free, massive amounts of examples abound and it's more versatile (I think) and most importantly for the guy coding it...requires less pure code written.

    Remember...my whole talk with you assumes inbound and outbound data. If inbound is the only need...xml is faster and more versatile because it can read the xml regardless of any need for php. Kiosks and standalones for example.

  12. #12
    up to my .as in code Chris_Seahorn's Avatar
    Join Date
    Dec 2004
    Posts
    4,389
    I should mention tupps is the real xml guru in here. He's one of those guys who's into it and you have to be to really get advanced. He maintains one of the best sites for introducing new users to xml objects and always posts some code here if needed. I was appointed here because I post both types (XML and MySQL) and we need code examples in some forums so I fit the bill but he is really the xml guy...even in my opinion

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