• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Action Script

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
}
 
is that Actionscript 2.0 ?

i'm taking a class in Flash AS 3.0. i hear good things about older versions of AS,
namely that it made it easier to do a lot of things.
 
Back
Top