0 Replies Latest reply on Apr 24, 2007 5:59 AM by alxsmth

    Mp3 player problems...

      I have been trying to adapt an mp3 player so that it always plays randomly from its xml playlist. I dont want this function to be able to be turned on and off, i just want constant random play, so there will be no need for any new buttons.

      The mp3 player has some scripting in the fla and has two external .as files, one controlling the xml load and one controlling the player. I am unsure where to put the script in for random play or how to script it. I would be incredibly appreciative if anyone could help me in this matter.

      } TextThe scripting in frame 1 of the timeline of the Fla goes as follows:

      var xmlClass = new Xmlload();
      var playClass = new Player();

      this.pause_btn.onRelease = function() {
      this.play_btn.onRelease = function() {


      } There is then two external .as files:


      class Player {


      var s:Sound;

      var cps:Number;

      var pos:Number;


      function Player() {

      s = new Sound();


      cps = -1;



      function playSong():Void {

      s = new Sound();

      if (cps == _root.xmlClass.sa.length-1) {

      cps = 0;

      s.loadSound(_root.xmlClass.sa[cps], true);

      _root.display_txt.text = _root.xmlClass.names[cps];

      } else {

      s.loadSound(_root.xmlClass.sa[++cps], true);

      _root.display_txt.text = _root.xmlClass.names[cps];



      function pauseIt():Void {

      pos = s.position;



      function unPauseIt():Void {




      } and


      import mx.utils.Delegate;

      class Xmlload {


      var nodes:Array;

      var sa:Array;

      var names:Array;

      var xml:XML;


      function Xmlload() {

      nodes = new Array();

      sa = new Array();

      names = new Array();

      xml = new XML();

      xml.ignoreWhite = true;




      public function delLoad():Void {

      xml.onLoad = Delegate.create(this, loadXml);



      public function loadXml():Void {

      nodes = xml.firstChild.childNodes;

      for (var i = 0; i<nodes.length; i++) {

      sa.push(nodes .attributes.url);