Hello once again, i'm having trouble with my ict project. Im trying to implement a menu system that allows me to play sound, however at the current moment as soon as i preview the movie the sound starts, im wondering if i can make the sound start when i click on the button?
The current action script is as follows:
soundObj = new Sound();//Create a sound object
soundObj.attachSound("Sound");//Attach our sound from the libary
soundObj.isPlaying = false;//set the playing var to false
//play button
_root.playBt.onRelease = function(){//when the play button is released
if(soundObj.isPlaying == false){//if the sound isn't already playing
_root.soundObj.start(0,99);//play the sound from the start and loop it 99 times
soundObj.isPlaying = true;//the sound is now playing, change the var to reflect this
}
}
//stop button
_root.stopBt.onRelease = function(){//when the stop button is clicked
_root.soundObj.stop();//stop the sound
soundObj.isPlaying = false;//set the isplaying var to false
}
The current action script is as follows:
soundObj = new Sound();//Create a sound object
soundObj.attachSound("Sound");//Attach our sound from the libary
soundObj.isPlaying = false;//set the playing var to false
//play button
_root.playBt.onRelease = function(){//when the play button is released
if(soundObj.isPlaying == false){//if the sound isn't already playing
_root.soundObj.start(0,99);//play the sound from the start and loop it 99 times
soundObj.isPlaying = true;//the sound is now playing, change the var to reflect this
}
}
//stop button
_root.stopBt.onRelease = function(){//when the stop button is clicked
_root.soundObj.stop();//stop the sound
soundObj.isPlaying = false;//set the isplaying var to false
}
