Call to a possibly undefined method stop through a reference with static type.flash.media.Sound
This error appears when I tried putting this code 'soundFx_1.stop();' inside a rollOut function. What does this mean?
This error appears when I tried putting this code 'soundFx_1.stop();' inside a rollOut function. What does this mean?
Oh I see. It doesn't play anymore when I exported the swf but the soundeffect is still playing when I mouseover to the items inside the cabinet movieClip. >.<
you're not stopping any sound in your mouseover listener function, only your rollover listener function:
var soundFx_2:Sound = new Sound(new URLRequest("Cabinet_Close.mp3"));
var soundFx_3:Sound = new Sound(new URLRequest("Cabinet_Open.mp3"));
var sc: SoundChannel;
Cabinet1_00.addEventListener(MouseEvent.MOUSE_OVER, fl_MouseOverHandler);
Cabinet1_00.addEventListener(MouseEvent.ROLL_OUT, fl_RollOutHandler);
if (this['showAcid3'] == null)
{
var showAcid3:Boolean = true;
}
showAcid3 = true;
function fl_MouseOverHandler(event:MouseEvent):void
{
Cabinet1_00.gotoAndStop('Open_0');
sc.stop();
sc=soundFx_3.play();
setChildIndex(Cabinet1_00, numChildren -1);
if (showAcid3 == true)
{
Cabinet1_00.Acid_3.gotoAndStop('Still');
Cabinet1_00.Acid_3.addEventListener(MouseEvent.CLICK, removeSelf);
}
else
{
Cabinet1_00.Acid_3.visible = false;
}
}
function removeSelf(e:MouseEvent):void
{
showAcid3 = false;
soundFx_1.play();
DisplayObject(e.target).removeEventListener(MouseEvent.CLICK, removeSelf);
}
function fl_RollOutHandler(event:MouseEvent):void
{
Cabinet1_00.gotoAndStop('Still');
sc.stop();
sc= soundFx_2.play();
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.