A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Volume Control in Flash 5

  1. #1
    Senior Member
    Join Date
    Oct 2001
    Posts
    127

    Cool

    I have got a jukebox style flash animation that i am working on, and need to have some kind of volume control in place. Could anybody please tell me how to do this?

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Use the sound object for this,

    (if you are not using it already)
    import your sound to flash, open the library and right click on the sound, select linkage and then choose export this symbol (or export for actionscript) now create a movie clip, fill in the linkage id

    in the first frame of this clip put the actions

    vol = 75;
    music = new Sound(this);
    music.attachSound("linkage_id"); // use the linkage id you chose here
    music.start(0,10); // loop the sound 10 times
    music.setVolume(vol);
    stop();

    now also in this clip you can make a volume control

    volume up

    on (release) {
    if (vol < 100);
    vol+=5;
    music.setVolume(vol);
    }
    }

    volume down

    on (release) {
    if (vol > 0);
    vol-=5;
    music.setVolume(vol);
    }
    }

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