Hi there,

I am a newby to actionscript, currently learning the code.
I am in a bit of a fix as I need to complete a job by Monday.

I got this code from O'Reilly's web site. The problem is the sound does not pause at all. I have added the linkage.

Your help/guidance will be greatly appreciated.

Thank you in advance.


Code:
// Attach a push button from the Library. You must first drag a push button from the
// Components panel to the Stage to create the Library symbol.
this.attachMovie("FPushButtonSymbol", "myPushButton", 1);

// Create a sound holder movie clip.
this.createEmptyMovieClip("soundHolder_mc", 2);

// Create the Sound object.
mySound_sound = new Sound(soundHolder_mc);

// Attach the sound from the Library. You must have a sound with the linkage
// identifier of MySoundSymbol for this to work.
mySound_sound.attachSound("MySoundSymbol");

// Define two callback functions. One resumes the sound, and the other pauses the
// sound. When each is called, it toggles the click handler for the push button to
// the other function.
function resumeSound (  ) {
  mySound_sound.resume(  );
  myPushButton.setClickHandler("pauseSound");
  myPushButton.setLabel("Pause Sound");
}

function pauseSound (  ) {
  mySound_sound.pause(  );
  myPushButton.setClickHandler("resumeSound");
  myPushButton.setLabel("Resume Sound");
}

// Define the initial click handler and label for the push button.
myPushButton.setClickHandler("pauseSound");
myPushButton.setLabel("Pause Sound");

// Tell the sound to start.
mySound_sound.start(  );