Ok, So I spent all day and I made this cool looking player thing for my shoutcast internet radio.
Now I want to use flash to code it, and then I’m going to make it a program in VB6. I want to use flash to code it because I know more flash then VB6, but I want to have that program look to it. So here are some features it will have…
Play and Stop the radio stream (No pause because you can’t pause a live broadcast stream)
Volume Bar (The long bar on the left)
Get current song from XML on server (Password Protected) or Get current song from /7.html (Not Password Protected)
Equalizer (The small repeated bars on the left and right)
Thing I am going to need advice for…
Importing the different graphics into flash and what file format to save them as.
Using a font that isn’t installed on everyones computer.
I know some flash but I’m not the best at it. I’m going to search from tutorials now and see what I can figure out on my own.
function loadXML(loaded) {
if (loaded) {
_root.songtitle = this.firstChild.childNodes[8].firstChild.nodeValue;
songtitle_txt.text = _root.songtitle;
} else {
trace(“Stats file not loaded!”);
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“http://domain.com:8000/admin.cgi?pass=*****&mode=viewxml”);
I wrote that using the a tutorial that I found here. I changed around the file path for security reasons. When I try it in flash it dosent load the current song though.
Here is my XML Document created by shoutcast…
<SHOUTCASTSERVER>
<CURRENTLISTENERS>1</CURRENTLISTENERS>
<PEAKLISTENERS>2</PEAKLISTENERS>
<MAXLISTENERS>50</MAXLISTENERS>
<REPORTEDLISTENERS>1</REPORTEDLISTENERS>
<AVERAGETIME>7126</AVERAGETIME>
<SERVERGENRE>Alternative</SERVERGENRE>
<SERVERURL>http://www.audiomonkey.org</SERVERURL>
<SERVERTITLE>Audio Monkey Radio (AMR)...Your Rock Alternative</SERVERTITLE>
<SONGTITLE>Norma Jean - The Human Face, Divine</SONGTITLE>
<SONGURL/>
<IRC>#shoutcast</IRC>
<ICQ>0</ICQ>
<AIM>N/A</AIM>
<WEBHITS>91</WEBHITS>
<STREAMHITS>13</STREAMHITS>
<STREAMSTATUS>1</STREAMSTATUS>
<BITRATE>64</BITRATE>
<CONTENT>audio/mpeg</CONTENT>
<VERSION>1.9.4</VERSION>
-<WEBDATA>
<INDEX>4</INDEX>
<LISTEN>0</LISTEN>
<PALM7>0</PALM7>
<LOGIN>0</LOGIN>
<LOGINFAIL>2</LOGINFAIL>
<PLAYED>0</PLAYED>
<COOKIE>0</COOKIE>
<ADMIN>0</ADMIN>
<UPDINFO>77</UPDINFO>
<KICKSRC>0</KICKSRC>
<KICKDST>0</KICKDST>
<UNBANDST>0</UNBANDST>
<BANDST>0</BANDST>
<VIEWBAN>0</VIEWBAN>
<UNRIPDST>0</UNRIPDST>
<RIPDST>0</RIPDST>
<VIEWRIP>0</VIEWRIP>
<VIEWXML>7</VIEWXML>
<VIEWLOG>0</VIEWLOG>
<INVALID>1</INVALID>
</WEBDATA>
-<LISTENERS>
-<LISTENER>
<HOSTNAME>**.***.***.***</HOSTNAME>
<USERAGENT>WinampMPEG/5.0</USERAGENT>
<UNDERRUNS>0</UNDERRUNS>
<CONNECTTIME>4057</CONNECTTIME>
<POINTER>0</POINTER>
<UID>8</UID>
</LISTENER>
</LISTENERS>
-<SONGHISTORY>
-<SONG>
<PLAYEDAT>1091408314</PLAYEDAT>
<TITLE>Norma Jean - The Human Face, Divine</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091408112</PLAYEDAT>
<TITLE>Papa Roach - last resort</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091407738</PLAYEDAT>
<TITLE>Nine Inch Nails - Closer</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091407644</PLAYEDAT>
<TITLE>New Found Glory - This Disaster</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091407452</PLAYEDAT>
-<TITLE>
New Found Glory - New Found Glory - Catalyst 12 I'd Kill To Fall Asleep
</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091407183</PLAYEDAT>
<TITLE>Incubus - Megalomaniac</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091406951</PLAYEDAT>
<TITLE>Hoobastank - The Reason</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091406673</PLAYEDAT>
<TITLE>Kernkraft 400 - Zombie Nation Remix</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091406307</PLAYEDAT>
<TITLE>Behind Blue Eyes - Limp Bizkit</TITLE>
</SONG>
-<SONG>
<PLAYEDAT>1091406130</PLAYEDAT>
<TITLE>Letter Kills - Don't Believe</TITLE>
</SONG>
</SONGHISTORY>
</SHOUTCASTSERVER>
I’m having similar problems getting a dynamic text field to display the currently playing song title.
I did notice that when I assign a textfield to display childNodes[0] that the field comes up with an ICY error message in it, like the following:
ICY 404 Resource Not Found
icy-notice1:
(it stops there)
I searched for the error and it’s a common error that gets returned by shoutcast when a stream is down/inactive/not streaming… but I know for a fact that the stream is working because I’m listening to it as I’m working.
I’m thinking Flash is being picky about something to do with the way Shoutcast dynamically spits out the xml file with the data in it…?