1 Reply Latest reply on Nov 5, 2007 3:37 AM by zilvester

    Call soundeffect without interaction

    zilvester Level 1
      Hi, I know how to make a soundeffect play on interaction:
      mouseDownEffect="{beep}

      but how do you make it play without... say from a function...?

      sorry for such a newbie question. thanx.
      Z
        • 1. Re: Call soundeffect without interaction
          zilvester Level 1
          wOW, thanx for all the replies ! ;-)

          import mx.core.SoundAsset;
          import flash.media.Sound;
          import flash.media.SoundChannel;

          [Embed(source="assets/audio/Ding.mp3")]
          public var soundClass:Class;
          public var snd:SoundAsset = new soundClass() as SoundAsset;
          public var sndChannel:SoundChannel;

          AND THEN LATER:
          sndChannel=snd.play();

          Z