PDA

View Full Version : XML in flash.



Swinkid
04-07-2008, 05:25 PM
Hey guys.

Ive madea AS2 script that plays shoutcast streams.

The info (IP, Station name etc..) is pulled from vars in the document and the rest of the script plays it.
I want to be able to add / remove Vars easily in a XML document so that i can add / remove stations when ever i feel like it without having to edit the FLA then re-uploading it to the site..

So the XML would be layed out like:

<STATION>
<Station IP>IP and port here</Station IP>
<Station Name> Station name here </Station name>
<Description> description here</Description>
</Station>

(I don't know how XML works so thats just a guess!)

And at the moment the AS for the vars is:

var chans = new Array();//[title,ip:port;stream.nsv,description]
chans[0] = ["Radio #1", "http://s2.viastreaming.net:7130;stream.nsv", "Latest hits.\nhttp://www.radio1.com"];
chans[1] = ["Classics", "http://193.112.14.122:8080;stream.nsv", "Classical music 24/7.\nhttp://www.classicradio.com"];
chans[2] = ["FunkRadio", "http://stream.funkradio.com:7130;stream.nsv", "Funk music!.\nVisit http://www.funkradio.com"];

Want to hide these adverts? Register an account for free!