Skip to main content
Known Participant
December 12, 2009
Answered

What is XML?

  • December 12, 2009
  • 2 replies
  • 718 views

I have seen alot of stuff that uses XML with flash. But what is XML exactly and what does it have to do with flash?

This topic has been closed for replies.
Correct answer kglad

xml is a flexible easy to read (for humans) file format that's used to store data.  ie, xml files can and are used like databases.

xml is used in flash to store data used by flash.  because xml is easier to edit for non-technically oriented people, xml files are often used to store data that can be changed by an individual thereby changing the flash display.

a common example is a slideshow.  the actual image file names and possibly text describing the images are frequently stored in an xml file.  flash reads the xml file and is coded to display the images and the text.  changing the xml file, changes the images displayed with no editing of the fla or swf file required.

2 replies

Known Participant
December 13, 2009

You can use XML to encode data very nicely. The syntax is a lot like HTML, with tags and everything, but whereas in HTML the tags are all predefined (like <body> and <a>, etc.), when you use XML you can define your own tags. So if you were creating an XML file to encode a phone book with two entries it might look like:

<phonebook>

     <entry>

          <name>

               Johnny Johnson

          </name>

          <number>

               (555) 555-5555

          </number>

     </entry>

     <entry>

          <name>

               Jimmy James

          </name>

          <number>

               (444) 444-4444

          </number>

     </entry>

</phonebook>

As you can see, the data is very easy tor ead and understand. XML is so flexible that you can use it for many purposes. For example, I use XML in all the communications between my Flash application and  the server which stores the user's information. Like most programming languages today Flash has a bunch of built in classes for manipulating XML. I convert an instance of a class into XML, the send it to the server where it is parsed into an object on the other side and the processed. But you can use XML in configuration files, in data that you store on disk (like save game files for games), in file formats that you define (like HTML uses it), etc. It is super flexible.

Technically, it is paradigm for defining mark-up languages (XML schemas). Technically HTML is just another XML schema, though it was defined before XML was invented!

Check this out for a fuller answer:

http://www.kirupa.com/developer/flashcs3/using_xml_as3_pg1.htm

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
December 12, 2009

xml is a flexible easy to read (for humans) file format that's used to store data.  ie, xml files can and are used like databases.

xml is used in flash to store data used by flash.  because xml is easier to edit for non-technically oriented people, xml files are often used to store data that can be changed by an individual thereby changing the flash display.

a common example is a slideshow.  the actual image file names and possibly text describing the images are frequently stored in an xml file.  flash reads the xml file and is coded to display the images and the text.  changing the xml file, changes the images displayed with no editing of the fla or swf file required.