A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Up volume button

  1. #1
    Junior Member
    Join Date
    Oct 2005
    Location
    Catasauqua,Pa
    Posts
    18

    Up volume button

    I have a button that starts and sets the volume of a song but I can figure on how to increase the volume when you click the button.

    function soundPage(event:MouseEvent):void {
    var n:Number = .1;
    var song:Sound = new coanan;
    var channel:SoundChannel;
    channel = song.play();
    var vol:SoundTransform = new SoundTransform;
    vol.volume=n;
    channel.soundTransform = vol;
    sound_mc.gotoAndPlay("rollout");
    sound_an.gotoAndPlay("rollout");

    }
    up_ro.addEventListener(MouseEvent.CLICK , upPage);
    function upPage(event:MouseEvent):void {
    //what code goes here//
    up_mc.gotoAndPlay("rollout");
    up_an.gotoAndPlay("rollout");

    }
    [/SIZE=4]Terry Elekes

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Use the SoundTransform class. If channel is the SoundChannel instance then you can change the volume by this:

    var transform:SoundTransform = channel.soundTransform;
    transform.volume = volume;
    - The right of the People to create Flash movies shall not be infringed. -

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