Some help with basic Sound functions in actionscript 3

Posted by danwoods on Stack Overflow See other posts from Stack Overflow or by danwoods
Published on 2009-05-28T12:59:43Z Indexed on 2010/03/31 2:03 UTC
Read the original article Hit count: 313

Filed under:
|

Hello all. I'm working on a mp3 player and I'm super new at all things flash so there are lots of questions. Currently I'm getting stuck on the track change. My variable declaration look like this:

var index:int = -1;  
var music:Sound = new Sound(new URLRequest("moe2008-05-24d02t02_vbr.mp3"));  
var sc:SoundChannel;  
var isPlaying:Boolean = false;

and my change track function looks like this:

function changeTrack(newTrack){  
    sc.stop();
    isPlaying = false;
    music = new Sound(new URLRequest(newTrack));
    sc = music.play();
    isPlaying = true;
    index++; 
}

Does anyone see any obvious errors??? Thanks

© Stack Overflow or respective owner

Related posts about actionscript-3

Related posts about sound