homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
Forum Library, Charter, Moderator: open

Flash and Shockwave Forum

how do i get my volume up?

10+ Year Member

Msg#: 3216763 posted 11:43 pm on Jan 11, 2007 (gmt 0)

my question has two parts...

i'm using the script below to fade out a song in the background. it works but on the next scene i need the volume back up again for a different track. how do i reverse what the script does?

also, when i jump to the next scene will the audio from the first scene be still playing? if so i need a way to stop the first track at the end of the first scene (it can be done abruptly since it will be faded out)

i have my audio attached to the main timelines by the way

// timew to play before fading out
FADEDELAY = 0000; // 25000 ms = 25 s

// length of the fading
FADELENGTH = 2000; // 2s

// methods to handle the fading

this.doFade = function() {
var elapsed = getTimer() - this.startTime;
if (elapsed >= this.FADELENGTH) {
delete this.onEnterFrame;
} else {
this.s.setVolume(100 - (elapsed*100/this.FADELENGTH));

this.startFading = function() {
this.startTime = getTimer();
this.s = new Sound(this);
this.onEnterFrame = this.doFade;

// go for it
this.startFading.fadeID = setInterval(this, "startFading", FADEDELAY);


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Flash and Shockwave
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved