Copy link to clipboard
Copied
hi . i make function (poooos) to stop the sound but it did not work why? can u help plz!
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundTransform;
import flash.net.URLRequest;
myppbtn.buttonMode = true;
var s:Sound = new Sound();
var sc:SoundChannel ;
var trans:SoundTransform = new SoundTransform (.5);
s.addEventListener(Event.COMPLETE,sloaded);
s.load(new URLRequest("jo.mp3"));
function sloaded(e:Event):void {
sc = s.play(0,1,trans);
}
myppbtn.addEventListener(MouseEvent.CLICK, poooos);
function poooos (e:MouseEvent):void{
sc.stop();
}
_________________________________________________________________________
the output write for me this massage but i don't understand
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at RECOVER_RECOVER_Untitled_1_fla::MainTimeline/poooos(
disable smart layers (modify>document>disable smart layers)
Copy link to clipboard
Copied
disable smart layers (modify>document>disable smart layers)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now