Skip to main content
Known Participant
December 1, 2018
Answered

stop sound

  • December 1, 2018
  • 1 reply
  • 332 views

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(

    This topic has been closed for replies.
    Correct answer kglad

    disable smart layers (modify>document>disable smart layers)

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    December 1, 2018

    disable smart layers (modify>document>disable smart layers)