To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-04-2009, 03:01 AM   #1
flashy5
Senior Member
 
Join Date: Jul 2001
Posts: 206
on mouse over fade in sound - how ?

hi all i have cd to introduce six songs

what will be the code if i want on muse over on any picture of the songs album the sound will start with fade in effect

and on mouse out the sound fade out and stop ??
flashy5 is offline   Reply With Quote
Old 11-04-2009, 10:11 AM   #2
a_modified_dog
FK'n_Mod
 
a_modified_dog's Avatar
 
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,175
you need to use a Sound Object.
see - How to Fade a Sound Object Up or Down

http://www.kennybellew.com/tutorial/
__________________
A Modified Domain .. [Flash 8][AS2] - [mySQL]
a_modified_dog is offline   Reply With Quote
Old 11-04-2009, 10:32 AM   #3
flashy5
Senior Member
 
Join Date: Jul 2001
Posts: 206
thx a lot for u i will visit it now
flashy5 is offline   Reply With Quote
Old 11-08-2009, 04:47 AM   #4
flashy5
Senior Member
 
Join Date: Jul 2001
Posts: 206
thx and i found a pgae to do something near what i want but when i try to edit the code i did not success

this is the page if any one can help

what i want is one button on mouse over then the sound will start fade in and if mouse out then it will fade out

thx


http://www.kennybellew.com/tutorial/fade.htm

Last edited by flashy5; 11-08-2009 at 04:53 AM.
flashy5 is offline   Reply With Quote
Old 11-08-2009, 07:16 AM   #5
a_modified_dog
FK'n_Mod
 
a_modified_dog's Avatar
 
Join Date: Apr 2003
Location: "aaarf"
Posts: 9,175
PHP Code:
/*
import your mp3 to the Library, give it a Linkage Identifier - myMP3
add a button to the stage - give it an instance name - fadeBtn
add this code to the main timeline, (same frame as the button)
*/

this.createEmptyMovieClip("clip",1000);
mySound = new Sound(clip);
mySound.attachSound("myMP3");

this.createEmptyMovieClip("FADEin",2000);
this.createEmptyMovieClip("FADEout",3000);

vol = 0;
inc = 0.5;
inc2 = 1;
songPlay = false;

function
fadeIn(){
FADEout.onEnterFrame = null;
mySound.setVolume(0);
if(!
songPlay) {
mySound.start();
songPlay = true;
}
FADEin.onEnterFrame = function(){
trace("fade in volume - "+vol)
vol>100 ? vol=100 : vol+=inc;
vol==100 ? FADEin.onEnterFrame = null : null;
mySound.setVolume(vol)
}
};

function
fadeOut(){
FADEin.onEnterFrame = null;
FADEout.onEnterFrame = function(){
trace("fade out volume - "+vol)
vol<0 ? vol=0 : vol-=inc2;
mySound.setVolume(vol);
if(
vol==0){
FADEout.onEnterFrame = null;
mySound.stop();
songPlay = false;
}
}
};

fadeBtn.onRollOver = function(){
fadeIn();
};

fadeBtn.onRollOut = function(){
fadeOut();
};
hope this helps
__________________
A Modified Domain .. [Flash 8][AS2] - [mySQL]
a_modified_dog is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:38 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.