|
Posted by SpaceGirl on 03/08/07 12:30
On Mar 5, 1:36 am, Onideus Mad Hatter <use...@backwater-
productions.net> wrote:
> On Wed, 28 Feb 2007 10:43:45 -0600, "Steve" <no....@example.com>
> wrote:
>
> >as i have been saying, he is the biggest cause of his own problems.
>
> I don't have problems, only solutions.
>
> >it's not
> >the fault of any technology he is using - which he quite contrarily
> >maintains.
>
> Which you have yet to prove otherwise, Mouth.
>
> >it is the way in which he uses any given technology. he clearly
> >has no depth of understanding of any he employs...that includes flash -
>
> Oh yes, I clearly have no depth of understanding...you know, except
> for all those bleeding edge Flash sites I keep churning out:http://www.backwater-productions.net/RMXP_CSG/
>
> Boy, reality sure is a bitch for you, innt Stevie?
>
> >don't confuse 'the most important' with 'the most popular'. THE MOST
> >important developing web technology is STILL XML.
>
> ...uh, XML isn't even REMOTELY the most important web technology...in
> fact it's pretty much the LEAST important since all it is, is a poor
> mans database. It's basically like...a database for dummies. ^_^
Here we go, ultra simple XML example:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<zones>
<zone>
<movie title="fanzone">zone1.swf</movie>
</zone>
<zone>
<movie title="two">zone1.swf</movie>
</zone>
<zone>
<movie title="three">zone1.swf</movie>
</zone>
<zone>
<movie title="news">zone1.swf</movie>
</zone>
<zone>
<movie title="welcome">zone1.swf</movie>
</zone>
<zone>
<movie title="six">zone1.swf</movie>
</zone>
<zone>
<movie title="gallery">zone1.swf</movie>
</zone>
<zone>
<movie title="seven">zone1.swf</movie>
</zone>
<zone>
<movie title="eight">zone1.swf</movie>
</zone>
</zones>
And here's the code that generates some Flash stuff based on it (AS2,
chopped code from a movie so may not run in this form):
var titles_xml:XML = new XML();
titles_xml.ignoreWhite = true;
var titleFromXML:String;
var clipName:String;
var urlFromXML:String;
titles_xml.onLoad = function(sucess) {
if (sucess) {
XML_titles(titles_xml);
} else {
trace("Couldn't load XML");
}
}
function XML_titles(xml_data) {
for (i in xml_data.firstChild.childNodes) {
titleFromXML =
xml_data.firstChild.childNodes[i].firstChild.attributes.title;
urlFromXML =
xml_data.firstChild.childNodes[i].firstChild.firstChild.nodeValue;
titleName = "title" + i + "_mc";
clipName = "clip" + i + "_mc";
titleName_alt = "title_alt" + i + "_mc";
slider_mc.attachMovie("moviePrototype_mc", clipName,
slider_mc.getNextHighestDepth());
slider_mc[titleName_alt].title_txt.text = titleFromXML;
slider_mc[titleName].title_txt.text = titleFromXML;
}
}
titles_xml.load("somedata.asp");
Try doing that without XML... it'd require MUCH more code. With the
code I have above, I barely have to modify anything if the XML
changes. It generates x number of clips, titles them etc from a single
XML document (which in turn can be a dynamic page that populates the
XML from a database). With a single tweak I can change the code from
using XML (from a URL) to use a Web Service. It would be a nightmare
trying to do this through para passing.
Okay your turn... post how to do this without XML, and less code,
that's easier to follow. Bet you can't :)
[Back to original message]
|