Mute Unmute Audio file on frame
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Mute Unmute Audio file on frame

  1. #1
    Junior Member
    Join Date
    Mar 2013
    Posts
    1

    Exclamation Mute Unmute Audio file on frame

    Ive inserted an audio file into my frame:


    var soundReq:URLRequest = new URLRequest("Sound_1.mp3");
    var sound:Sound = new Sound();
    sound.load(soundReq);
    sound.addEventListener(Event.COMPLETE, onComplete);
    //end of sound section

    function onComplete(event:Event):void
    {
    sound.play();
    }


    I would like to know how would i mute and unmute this ....?

    Im new to all this so please take it easy, any much would be much appreciated.

    Regards
    Enam

  2. #2
    Dignitary rynoe's Avatar
    Join Date
    Jan 2003
    Location
    Earth
    Posts
    756
    Your close, you just need to add a sound channel:

    var channel1:SoundChannel = new SoundChannel();
    var volumeAdjust:SoundTransform = new SoundTransform();
    volumeAdjust.volume = .5;

    channel1 = sound.play();
    channel1.soundTransform = volumeAdjust;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com