| Ultrashock Forums
• Problems with streaming in Safari |
|||
![]() |
||||
| Search this Thread | Thread Tools | Display Modes |
|
|
|||||||||||||||||||||||||
![]() |
Ultrashock Member Comments:
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|


.
1 comment
| 607 views



Linear Mode
myReceiver = new LocalConnection();
myReceiver.connect("myConnections");
myReceiver.myAction = function(id) {
_root.LoadMe(id);
};
myReceiver.stopplay = function(id) {
_root.ns_mp3.pause();
_root.ispause=true;
_root.pause.offOn.gotoAndPlay("to off");
};
_root.setStartVolume=true;
_root.LoadMe("default");
function LoadMe(id){
_root.externalXML = new XML ();
_root.externalXML.onLoad = onComplete;
var action:String = "get.php?id="+id+"&action=songxml";
//_root.externalXML.load ("designer.xml");
_root.externalXML.load (action);
XML.prototype.ignoreWhite = true;
_root.id=id;
function onComplete(){
var itemName:String = _root.externalXML.firstChild.attributes.name;
var itemLength:Number = _root.externalXML.firstChild.childNodes.length;
_root.songList=new Array();
for (var i:Number = 0; i < itemLength; i++) {
_root.songList[i] = new Array();
_root.songList[i][0]=_root.externalXML.firstChild.childNodes[i].attributes['path'];
_root.songList[i][1]=itemName;
_root.songList[i][2]=_root.externalXML.firstChild.childNodes[i].attributes['artist'];
_root.songList[i][3]=_root.externalXML.firstChild.childNodes[i].attributes['name'];
}
playSongs();
if(_root.setStartVolume){
_root.soundControl.setVolume(30);
_root.setStartVolume=false;
}
}
function playSongs(){
_root.mycount=0;
_root.nc = new NetConnection();
_root.nc.onStatus = function(info) {trace(info.code);}
_root.nc.connect("rtmp://qstream-fl0.qbrick.com/05966");
_root.ns_mp3 = new NetStream(_root.nc);
_root.ns_mp3.onStatus = function(info) {trace(info.code);}
_root.ns_mp3.onPlayStatus = function(info) {
_root.mycount++;
count=_root.mycount;
_root.ns_mp3.play("mp3:"+songList[count][0]);
_root.track.dataDisplay.displayMC.song.text=songList[count][3];
_root.track.dataDisplay.displayMC.artist.text=songList[count][2];
_root.track.dataDisplay.displayMC.kanal.text=_root.songList[count][1];
}
_root.ns_mp3.play("mp3:"+songList[0][0]);
_root.track.dataDisplay.displayMC.song.text=songList[0][3];
_root.track.dataDisplay.displayMC.artist.text=songList[0][2];
_root.track.dataDisplay.displayMC.kanal.text=_root.songList[0][1];
_root.mc.attachAudio(_root.ns_mp3);
_root.soundControl = new Sound(_root.mc);
}
}
stop();