IT WORKS! Thanks, Felix. :D
I also used the same method to add a sound event to thumbnails. I'll share the info with others.
If anyone else wants add a (onRelease) sound event to the thumbnail navigation arrow buttons or to the thumbnails themselves, do the following:
1) Import a sound file (e.g. click.wav) into simpleviewer.fla. In the LIBRARY window, right-click click.wav and select LINKAGE.
2) Tick the options EXPORT FOR ACTIONSCRIPT and EXPORT IN FIRST FRAME. In the IDENTIFIER entry, give it a name e.g. clicksound. Remember this identifier name.
3) To add a sound event to the thumbnail navigation arrow (same script works for NEXT and PREV arrows), open RolloverButton.as. Scroll down until you see the following actionscript:
public function onRelease(){
if (!mEnabled) return;
mClip_mc._x -= mClickShift;
mClip_mc._y -= mClickShift;
doAction();
}
Insert the following (denoted in red) into the actionscript above:
public function onRelease(){
var mySound = new Sound(mClip_mc);
mySound.attachSound("clicksound");
mySound.start(0, 1);
if (!mEnabled) return;
mClip_mc._x -= mClickShift;
mClip_mc._y -= mClickShift;
doAction();
}
4) To add a sound event to the thumbnails, open Thumb.as. Scroll down until you see the following actionscript:
private function onRelease(){
if (mSelected ) return;
mBase_mc._x -= Options.thumbnailClickShift;
mBase_mc._y -= Options.thumbnailClickShift;
mThumbArea.selectedThumbIndex = mIndex;
}
Insert the following (denoted in red) into the actionscript above:
private function onRelease(){
var mySound = new Sound(mClip_mc);
mySound.attachSound("clicksound");
mySound.start(0, 1);
if (mSelected ) return;
mBase_mc._x -= Options.thumbnailClickShift;
mBase_mc._y -= Options.thumbnailClickShift;
mThumbArea.selectedThumbIndex = mIndex;
}
5) Save both .as files. Return to simpleviewer.fla and republish viewer.swf. Play viewer.swf and the sound event(s) should happen.
Hope the info helps.
Rgds,
Dan