Hi all,
I have an animation that is on a sliding navigation bar. When the user mouses over the sliding nav it pops up and triggers the animation. The animation is of a subway train rolling in. I have some sound effects for the subway - one of air brakes as the train comes to a halt, and another for the train rolling out (another animation after the user presses a button). All sounds are defined at the root.
Here is the problem - the sound of the train rolling out, which is triggered when the user hits a button and the train --> out animation is triggered, works fine every time. The sound of the train coming to a stop works fine the first time but that’s it.
Here is the code I am using for the sliding nav, which is on the main timeline and was written by Voetsjoeba; it also contains the call for the first sound:
trainStop = new Sound();
trainStop.attachSound("airbrake");
this.onEnterFrame = function() {
if (slidingNav.hitTest(_xmouse, _ymouse)) {
_root.slidingNav.trainIn.gotoAndPlay(2);
if (playing != true) {
_root.trainStop.start(0, 0);
playing = true;
}
delete this.onEnterFrame;
}
};
Any ideas why it won’t work after the first time?
