I am trying to make a button that will start the sound on one click and then stop it if you click again. When I check the code for errors in the action panel it says that there is no error but when I test the movie 2 error messages come up. Could use some help to fix. New to AS3
play_mc.addEventListener(MouseEvent.CLICK , playSong);
function playSong(MouseEvent):void {
var music:Number = 0;
var song:Sound = new conna();
var pausePos:Number = song.position;
if (music!=1) {
if (pausePos==0) {
pausePos=1;
song.play();
music=0;
}
} else {
if (music==0) {
pausePos=pausePos/1000;
song.stopAll();
music=1;
}
}
}