Hello Everyone,
I have a script on a button…
When I rollOver, the sound starts.
When I rollOut, the sound stops.
But what could I add to make the
sound loop until I rollOut?
Here’s the script on my button…
on (rollOver) {
myMusic = new Sound(this);
myMusic.attachSound(“sound_effect”);
myMusic.start();
}
on (rollOut) {
myMusic.stop();
}
Thanks!
Neuhaus3000
system
February 27, 2003, 8:50pm
2
add the loop parameter in this line:
myMusic.start(secondsoffset, loop);
something like
myMusic.start(0, 999);
would do
system
February 27, 2003, 8:53pm
3
Dude, your fast !
Thanks… I will try this.
I’m sure it will work !
Have a nice day! :beam:
Neuhaus3000
system
February 27, 2003, 8:58pm
5
Works fine for the looping ! =)
But on rollout, it doesn’t stop… :x
Is this code ok ? I think so…
on (rollOut) {
myMusic.stop();
}
I also noticed that when I use
actionScript to open a sound,
It appears louder !.. What the ?!?
Neuhaus3000
system
February 27, 2003, 9:21pm
6
:stunned:
can you attach your fla ?
and if you don’t want it that louder …
myMusic.setVolume(volume);
system
February 28, 2003, 2:06pm
7
Hey Kax,
Attach my fla ?
I can attach the sound symbol from the library.
But I can’t make it stop with this script :
on (rollOut) {
myMusic.stop();
}
Thanks for the volume script! :beam:
Neuhaus3000
system
February 28, 2003, 2:37pm
8
attach your fla file in your post
i don’t know why it’s not working … that’s why i’d like to see your file
system
February 28, 2003, 3:36pm
9
u can try
myMusic.stop(“sound_effect”);
system
February 28, 2003, 4:59pm
10
Hey Eudora, thanks for the tip!
This is logical and it should work…
but it doesn’t :-\
The volume doesn’t work either.
This is what I’ve got :
on (rollOver) {
myMusic = new Sound(this);
myMusic.attachSound(“sound_effect”);
myMusic.start(0, 999);
myMusic.setVolume(50);
}
on (rollOut) {
myMusic.stop(“sound_effect”);
}
Man, I tell ya… :sigh: Everything seems to be
in the right place.
Any clue ? I will make some more tests tonight. :hangover:
Thank you all !!!
Neuhaus3000
system
February 28, 2003, 5:23pm
11
on (rollOver) {
myMusic = new Sound(this);
myMusic.attachSound("sound_effect");
myMusic.setVolume(50);
myMusic.start(0, 999);
}
on (rollOut) {
myMusic.stop();
}
weird … i just tested it and everything worked perfectly :-\
system
March 3, 2003, 3:26pm
12
It worked! :crazy:
I ajusted a couple of things…
Deleted the audio in my “Over” button state (settled the volume problem); :sigh:
Disabled the linkage “add in 1st frame” and added the sounds in blank frames (settled the long 1 frame downloading);
Many Thanks !!!
Neuhaus3000
code:
on (rollOver) {
myMusic = new Sound(this);
myMusic.attachSound(“sound_effect”);
myMusic.setVolume(50);
myMusic.start(0, 999);
}
on (rollOut) {
myMusic.stop();
}
system
March 3, 2003, 4:05pm
14
I have on other bug that I can’t quite get an answer…
I’m loading a movie above an other one
but the the buttons on the movie underneath
are still active. Do you know how to disable them?
:crazy:
Thanks!
Neuhaus3000
system
March 3, 2003, 4:16pm
15
<a href=“http://www.kirupaforum.com/search.php?s= ”>
<img border=“0” src=“http://www.kirupaforum.com/images/search_top.gif ” width=“56” height=“18”></a>
MovieClip.prototype.enable = function(action) {
for (k in this) {
this[k].enabled = action;
}
}
// to enable
instance.enable(true);
// to disable
instance.enable(false);
instance can be a movie clip if you’re loading into target or a level
system
March 3, 2003, 4:17pm
16
btuttonname.enabled=false
Grim
system
March 3, 2003, 4:35pm
17
Hey Kax,
Wooooohooo ! =)
But I can’t quite seem to know how to add the script
to my movie…
I have a main movie (level0) that loads a movie on level 1.
On my level 1, I have a button that loads a movie
on level 2.
I want to disable only my buttons on level 1
when the movie on level 2 has loaded and
when I unload the movie on level 2, I want
my buttons to be enabled again :crazy:
Structure
Level_0 (main movie)
|
Level_1 (movie where my buttons are and should be disabled)
|
Level_2 (when I unload this movie, I should enable
my buttons on level_1 again)
So I have to add the script where exactly ? ;(
Thanks a million !!!
Neuhaus3000
system
March 3, 2003, 4:41pm
18
you would have
_level1.enable(false);
in the first frame of the movie loaded at level 2
when you unload the movie just use
_level1.enable(true);
and your buttons will recover its functionality
system
March 3, 2003, 4:52pm
19
And …
MovieClip.prototype.enable = function(action) {
for (k in this) {
this[k].enabled = action;
}
}
…would go on the button that calls the movie on level2… right?
It would look like :
on (release) {
MovieClip.prototype.enable = function(action) {
for (k in this) {
this[k].enabled = action;
}
}
}
Neuhaus3000
system
March 3, 2003, 4:58pm
20
sorry … i should have told you before
place it in the timeline