<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Code The World — Streaming Flash AS2  MP3 player]]></title>
		<link>https://codetheworld.com/viewtopic.php?id=118</link>
		<atom:link href="https://codetheworld.com/extern.php?action=feed&amp;tid=118&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Streaming Flash AS2  MP3 player.]]></description>
		<lastBuildDate>Fri, 14 May 2010 05:25:53 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Streaming Flash AS2  MP3 player]]></title>
			<link>https://codetheworld.com/viewtopic.php?pid=374#p374</link>
			<description><![CDATA[<p><a href="https://dcloser11.info/audioplayer.html">Working Example</a><br /><a href="https://dcloser11.info/mp3.rar">Adobe CS4 project files </a></p><p>All you have to do is edit the Playlist.xml to your desires and you are able to have your own streaming media player <img src="https://codetheworld.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p><p>Iv included the .fla incase anyone would like to load it into flash and see what code was used and its functions</p><p>A working example is also included</p><p>Action script 2 code that was used<br /></p><div class="codebox"><pre><code>stop();
playlist= new XML();
playlist.ignoreWhite=true;
playlist.onload = function (success) {
if(success) {
_global.songname = [];
_global.songfile = [];
for (var i=0; i&lt;playlist.firstChild.childNodes.length; i++) {
_global.songname = playlist.firstChild.childNodes[i].attributes.name;
_global.songfile[i] = playlist.firstChild.childNodes[i].attributes.file;
trace(songname[i]+\&quot; \&quot;+songfile[i]); }
_root.createEmptyMovieClip(\&quot;sound_mc\&quot;,1);
_root.sound_mc.sound_obj = new Sound();
_global.song_nr = random(songfile.length); _root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]); 
} else {display_txt.text=\&quot;Error Loading XML\&quot;}
}

MovieClip.prototype.songStarter = function (file, name) {
this.sound_obj.loadSound(file,true)
this.onEnterFrame = function () {
if(this.sound_obj.position&gt;0) {
delete this.onEnterFrame;
this._parent.display_txt.text=name; 
} else {
this._parent.display_txt.text=\&quot;loading...\&quot; 
}
}
this.sound_obj.onSoundComplete = function () {
(song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);
}
}

btn_play.onRelease = function () {
this._parent.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);
}
btn_stop.onRelease = function() {
this._parent.sound_mc.sound_obj.stop(); 
}
btn_next.onRelease = function () {
(song_nr==songfile.length-1)? _global.song_nr=0 : _global.song_nr++;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);
}
btn_prev.onRelease = function () {
(song_nr==0)? _global.song_nr=songfile.length-1 : _global.song_nr--;
_root.sound_mc.songStarter(songfile[song_nr],songname[song_nr]);
}

playlist.load(\&quot;playlist.xml\&quot;);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (DCLoser11)]]></author>
			<pubDate>Fri, 14 May 2010 05:25:53 +0000</pubDate>
			<guid>https://codetheworld.com/viewtopic.php?pid=374#p374</guid>
		</item>
	</channel>
</rss>
