1 Reply Latest reply on Jun 8, 2007 3:31 PM by kglad

    MP3 Streaming Music

    TRI0N
      Ok I'm using the following code at the moment becasue it works. But this option means that the mp3 needs to be inside the swf making the load time not what I was looking for.

      mySong.mp3 has the instance of "music".

      var tune:Sound = new Sound();
      tune.attachSound("music", true);
      tune.start();

      play_mc.onPress = function() {
      tune.stop();
      tune.start();
      }

      stop_mc.onPress = function() {
      tune.stop();
      }

      Now what I would like to do is remove the MP3 out of the flash file and use this code to call the mySong.mp3 to stream the music and play it. This is the code I attempted to use in Action Script 2.0. Of course the MP3 is located in the same directory that the published MusicPlayer.swf is located. This however does not stream and play my mp3 file. Any help would be great.

      var tune:Sound = new Sound();
      tune.attachSound("mySong.mp3", true);
      tune.start();

      play_mc.onPress = function() {
      tune.stop();
      tune.start();
      }

      stop_mc.onPress = function() {
      tune.stop();
      }