Código :
function initialize() { _root.connect.streamStr.text = "http://aquivaladirecciondemiradio/"; _root.connect.connectStr.text = "rtmp://aquivamirtmp/shoutcast"; _root.connect.connectButton.onPress = _root.doConnect; _root.connect.connectButton2.onPress = _root.doConnect; metaDataValues.title = ""; metaDataValues.genre = ""; metaDataValues.name = ""; metaDataValues.url = ""; doConnect(); trace (System.capabilities.version); } // End of the function function updateMetaData() { var _loc1 = ""; if (metaDataValues.title != "") { _loc1 = _loc1 + ("<b><font size=\'11\'>" + metaDataValues.title + "</font></b>\n"); } // end if var _loc2 = ""; _loc2 = _loc2 + metaDataValues.title; texto1.text = _loc2; if (metaDataValues.name != "") { } // end if if (metaDataValues.url != "") { } // end if metaDataText.text = _loc1; texto1.html = true; texto1.htmlText = _loc1; } // End of the function function doConnect() { if (nc == null) { nc = new NetConnection(); nc.onStatus = function (infoObject) { trace ("nc: " + infoObject.code + " (" + infoObject.description + ")"); if (infoObject.code == "NetConnection.Connect.Success") { playShoutcast(); } // end if }; nc.connect(_root.connect.connectStr.text); enablePlayControls(true); } else { if (nsPlay != null) { nsPlay.attachVideo(null); nsPlay.attachAudio(null); } // end if nsPlay = null; nc.close(); nc = null; metaDataValues.title = ""; metaDataValues.genre = ""; metaDataValues.name = ""; metaDataValues.url = ""; updateMetaData(); enablePlayControls(false); } // end else if } // End of the function function enablePlayControls(isEnable) { } // End of the function function playShoutcast() { nsPlay = new NetStream(nc); nsPlay.onStatus = function (infoObject) { trace ("nsPlay: " + infoObject.code + " (" + infoObject.description + ")"); }; nsPlay.onHeaderData = function (infoObject) { trace ("onHeaderData"); for (var _loc2 in infoObject) { trace (" " + _loc2 + " = " + infoObject[_loc2]); } // end of for...in if (infoObject["icy-genre"] != undefined) { metaDataValues.genre = infoObject["icy-genre"]; } // end if if (infoObject["icy-name"] != undefined) { metaDataValues.name = infoObject["icy-name"]; } // end if updateMetaData(); }; nsPlay.onMetaData = function (infoObject) { trace ("onMetaData"); for (var _loc2 in infoObject) { trace (" " + _loc2 + " = " + infoObject[_loc2]); } // end of for...in if (infoObject.StreamTitle != undefined) { metaDataValues.title = infoObject.StreamTitle; } // end if if (infoObject.StreamUrl != undefined) { metaDataValues.url = infoObject.StreamUrl; } // end if updateMetaData(); }; nsPlay.setBufferTime(5); nsPlay.play(_root.connect.streamStr.text); soundRemote.attachAudio(nsPlay); } // End of the function this.mc_vc.show_percent = true; this.mc_vc.shadow = {distance: 0, angle: 0, color: 0}; var nc = null; var nsPlay = null; var metaDataValues = new Array(); Stage.align = "TL"; Stage.scaleMode = "noScale"; _global.style.setStyle("backgroundColor", "0xFFCC00 "); initialize(); _root.musicPlayer.gotoAndPlay(1); musicPlays = true;