I have a button that does three things when you release on it. See code below;
mySpeed = 0;
drive = function(){
//speed text
Speed_txt = mySpeed+" kph";
mySound = new Sound();
mySound.attachSound(“bike”);
};
speedUp_btn.onRelease = function() {
mySpeed += 5;
mySound.start();
mySound.setVolume(mySpeed);
};
speeddown_btn.onRelease = function(){
mySpeed -= 5;
mySound.setVolume(mySpeed);
};
_root.onEnterFrame = drive;
my question is that on the first release i want mySound to start and also set the volume. I want the volume to increase as mySpeed increases. But when I release a secound or third time to increase mySpeed it start mySound again. How could I fix this so mySound only starts once.