Outline ·
[ Standard ] ·
Linear+
flash mx help with sound file
|
TSsmokey
|
Mar 15 2006, 07:02 PM, updated 20y ago
|
|
QUOTE on (release) { music = new Sound(); music.attachSound("mix1"); music.start(0, 999999); // set the volume of the sound to zero music.setVolume(0); // set a variable named 'vol' vol = 0; // set another variable named 'fade', putting a setInterval function in it fade = setInterval(fadeIn, 100); // set the initial fade in function function fadeIn() { // fade the sound in with an increment of 3 in the variable 'vol' vol += 3; music.setVolume(vol); // put an if condition to restrict the increment in volume after it reaches to 100 if (vol>=100) { clearInterval(fade); // create the 'step' variable step = 1; // create the 'fade' variable Fade = 0; } } // create the fade in and out function // function executed on onEnterFrame _root.onEnterFrame = function() { // set fade out if (Fade == 1) { vol = vol-step; if (vol<0) { vol = 0; } music.setVolume(vol); // set fade in } else { vol = vol+step; if (vol>100) { vol = 100; } music.setVolume(vol); } }; } hi...im super noobie in flash...i have a button tat play the music when being clicked...but how do i add a script that will ignore mouse clicks on that button once the music is playing? above is the script i currently using... thanks for reading
|
|
|
|
|
|
fantagero
|
Mar 15 2006, 07:07 PM
|
|
IMHO maybe u should attach the zipped FLA file too.. huhuhh.. sometimes it depend on how u put the sc
|
|
|
|
|
|
TSsmokey
|
Mar 15 2006, 07:13 PM
|
|
here: my work is very messy with alot of layers... Attached File(s)
nizam.zip ( 1.55mb )
Number of downloads: 8
|
|
|
|
|
|
fantagero
|
Mar 15 2006, 09:16 PM
|
|
u mean.. when the movie play.. the music is off.. then click to turn on the music... after the music played.... we cant click the button nemore???
|
|
|
|
|
|
TSsmokey
|
Mar 16 2006, 11:40 AM
|
|
QUOTE(fantagero @ Mar 15 2006, 09:16 PM) u mean.. when the movie play.. the music is off.. then click to turn on the music... after the music played.... we cant click the button nemore??? yes... or we can click it but the music wont launch the song for a few times everytime click...
|
|
|
|
|
|
momochi zabuza
|
Mar 16 2006, 03:56 PM
|
|
[ a script that will ignore mouse clicks on that button once the music is playing? ]
ok.. you can do it like this
at first click .. it will play the song at 2nd .. it wont play nemore
the theory is 1st.. when click.. it will give variable.. then at 2nd.. it will check variable if it is oledi play or not.. if oledi play.. then it will stop.
i = 0 for ( i = 0, i <1, i ++ ){ if ( i == 0){ music.play() i++ } else if ( i == 1){ music.stop() i == 0 } }
give it a try.. and correct me if i was wrong.
|
|
|
|
|
|
fantagero
|
Mar 16 2006, 06:11 PM
|
|
i have look at ur work yet as i'm using the old MX.. roughly, why dont u hide the button on one false button.. maybe just make the button disappear... ehmmm i'll install the nu xp ASAP k..
|
|
|
|
|
|
TSsmokey
|
Mar 17 2006, 09:59 AM
|
|
yes...i have done it... i jz need to give the play button a instance name (exp:play_btn) then in the actionscript i put QUOTE on (release){ play_btn.enabled = false;} hei...nice portpolio u have...can i ask a few questions? how to make the music visualization at the bottom right of ur page? and how do u set the 'movement of the underline' at ur button moves only once?(my 'shining part' is looping when u hover at my button...i have set my 'shining part' movie play once only but is still same)... do u have any link that can show me the tutorial? 10s for helping This post has been edited by smokey: Mar 17 2006, 10:52 AM
|
|
|
|
|
|
fantagero
|
Mar 17 2006, 11:27 AM
|
|
QUOTE(smokey @ Mar 17 2006, 09:59 AM) yes...i have done it... i jz need to give the play button a instance name (exp:play_btn) then in the actionscript i put hei...nice portpolio u have...can i ask a few questions? how to make the music visualization at the bottom right of ur page? and how do u set the 'movement of the underline' at ur button moves only once?(my 'shining part' is looping when u hover at my button...i have set my 'shining part' movie play once only but is still same)... do u have any link that can show me the tutorial? 10s for helping how u set ur shining part moving once??? imho for not letting ur shining part button looping... just simply put action stop at the end of the animation....
music visualization, u can simply search at flashkit.com...
|
|
|
|
|
|
TSsmokey
|
Mar 18 2006, 12:00 AM
|
|
thanks a lot to everybody's help...this thread shall be closed now
|
|
|
|
|