Hi,
Here we will learn how to make flash movie, which can communicate with XML data. I am not going to delve into the details of XML here. But quickly go through the process of getting data from XML into Flash.
First we must understand XML, though not thoroughly, but atleast the basics. XML is a data storing language.Its not like HTML, which is a presentaion language. So basically XML files store some data.Thats more than enough for this lesson.we can write xml files by simply opening our notepad and typing in the tags.then saving the file with ".xml" extension. we can save the file with ".txt" extension too.But then we have to rename it, so that the extension will be ".xml". Now, how it stores the data? Well it stores all the datas in the form of "Elements" or "Nodes". Whats that ?!! That is,
<name>my name</name>
This is a basic exmple of a xml node. we start a node by a start tag say "<node>", and end the tag with a end tag of same name "</node>".So a node is like
<me></me>
The above thing is a node which contains no data. See the name of teh node is not important, unlike HTML where we have pre defined tag names.So we can create any node with any name.Though there is also a naming convention, which should be used, and there are certain rules to name a node, but for our understanding here and to keep things simple at first go we will not delve into the details of those right now.Just understand that to name a node, it should consist of alphabets only.So we can create nodes like the following
<name></name>
<value></value>
<age></age>
Now, where to put data.We data is stored inside the start tag and end tag of nodes.So lets put some value in our nodes.
<name>my name</name>
<value>555</value>
Thats great. Now lets say we want to put a person's data.And in the long run, I have to go on putting different people's data in my XML to create my XML addressbook.Ok, Now we will create kind of datas inside datas.Simply I can put nodes inside nodes. As I put some value inside my nodes, I can put nodes also, instead of values, like
<me><name>saumya</name><no>678</no></me>
See, I have put nodes inside nodes.To better understand we generally write this as
<me>
<name>saumya</name>
<no>678</no>
</me>
Makes sense? yeah. "me" node contains all the datas regarding me. Now to make it generalised, I thought, "me" should be changed to "person".So that I can put any body's data.well, now the XML will look like
<person>
<name>saumya</name>
<no>678</no>
</person>
(more…)