Welcome Guest ( Log In | Register )

Bump Topic Topic Closed RSS Feed

Outline · [ Standard ] · Linear+

 flash mx help with sound file

views
     
TSsmokey
post Mar 15 2006, 07:02 PM, updated 20y ago

Infinity speed
*******
Senior Member
3,506 posts

Joined: Jan 2003
From: Lumpur
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
post Mar 15 2006, 07:07 PM

[ToFish4RepliesLikeYours]
*******
Senior Member
2,723 posts

Joined: Jan 2006
From: Pekopon Planet ~~~



IMHO
maybe u should attach the zipped FLA file too..
huhuhh.. sometimes it depend on how u put the sc biggrin.gif
TSsmokey
post Mar 15 2006, 07:13 PM

Infinity speed
*******
Senior Member
3,506 posts

Joined: Jan 2003
From: Lumpur
here:

my work is very messy with alot of layers... sad.gif


Attached File(s)
Attached File  nizam.zip ( 1.55mb ) Number of downloads: 8
fantagero
post Mar 15 2006, 09:16 PM

[ToFish4RepliesLikeYours]
*******
Senior Member
2,723 posts

Joined: Jan 2006
From: Pekopon Planet ~~~



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
post Mar 16 2006, 11:40 AM

Infinity speed
*******
Senior Member
3,506 posts

Joined: Jan 2003
From: Lumpur
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
post Mar 16 2006, 03:56 PM

I never think about money, beautiful things make money
*****
Senior Member
719 posts

Joined: Jan 2003
From: cyberjaya, ampang, malaysia


[ 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
post Mar 16 2006, 06:11 PM

[ToFish4RepliesLikeYours]
*******
Senior Member
2,723 posts

Joined: Jan 2006
From: Pekopon Planet ~~~



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.. biggrin.gif
TSsmokey
post Mar 17 2006, 09:59 AM

Infinity speed
*******
Senior Member
3,506 posts

Joined: Jan 2003
From: Lumpur
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
post Mar 17 2006, 11:27 AM

[ToFish4RepliesLikeYours]
*******
Senior Member
2,723 posts

Joined: Jan 2006
From: Pekopon Planet ~~~



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....
Attached Image
music visualization, u can simply search at flashkit.com... biggrin.gif
TSsmokey
post Mar 18 2006, 12:00 AM

Infinity speed
*******
Senior Member
3,506 posts

Joined: Jan 2003
From: Lumpur
thanks a lot to everybody's help...this thread shall be closed now smile.gif

Topic ClosedOptions
 

Change to:
| Lo-Fi Version
0.0124sec    0.80    6 queries    GZIP Disabled
Time is now: 25th November 2025 - 09:14 AM