jns
March 22, 2003, 3:45pm
1
hi,
sorry for being such a greenhorn, but i have the following problem:
i have a console wherein i can load movies and sounds. there are 3 movie-buttons and 3 sound-buttons. (you can combine every sound with every movie)
is there a possibility to makee the buttons “sticky” to see which buttons are pushed?
thanks a lot
jsn
system
March 22, 2003, 4:43pm
2
Ahh… you wanna make it where the buttons stay pressed down as soon as you push it… But if they push it again to push it back up?
Place the following code in the frame that the buttons reside in…
[AS]
_root.onLoad = function()
{
but1OnOff = FALSE;
but2OnOff = FALSE;
but3OnOff = FALSE;
}
but1.onPress = function()
{
if(but1OnOff == FALSE)
{
but1OnOff = TRUE;
this.gotoAndStop(2);
} else {
but1OnOff = FALSE;
this.gotoAndStop(1);
}
}
but2.onPress = function()
{
if(but2OnOff == FALSE)
{
but2OnOff = TRUE;
this.gotoAndStop(2);
} else {
but2OnOff = FALSE;
this.gotoAndStop(1);
}
}
but3.onPress = function()
{
if(but3OnOff == FALSE)
{
but3OnOff = TRUE;
this.gotoAndStop(2);
} else {
but3OnOff = FALSE;
this.gotoAndStop(1);
}
}
[/AS]
Now… Each of your buttons movieclips should contain 2 frames… The first frame is the button when it’s not clicked in… The second one is when it is clicked in… You should have a stop(); AS code in each of these frames.
Hope this helped you out. Have fun posting around.
system
March 22, 2003, 5:38pm
3
thanx,
i will try it…
jns
system
March 23, 2003, 12:48am
4
Yeah… Gimme some feedback if it worked out for you or not… If it didn’t… I’ll see what I can do for you :beam::player:
system
March 23, 2003, 7:08pm
5
hi playamarz,
thanks a lot for for your hints.
your script works perfect, but i think i made a wrong description:
if there is one button pressed and another button is getting pressed, the first one should pop up again to default position.
but thanks i think i will find a way starting with your script to solve this little problem…
if i get stuck somewhere i will ask again
=)
system
March 24, 2003, 12:11am
6
i get stucked…
i worked a little on this matter, but i still wonder how i will get a kind of mouseover?
this is what i done… mayby there could be some improvements in this case…
_root.onLoad = function() {
but1OnOff = false;
but2OnOff = false;
but3OnOff = false;
};
but1.onPress = function() {
if (but1OnOff == false) {
but1OnOff = true;
but2OnOff = false;
but3OnOff = false;
but1.gotoAndStop(2);
but2.gotoAndStop(1);
but3.gotoAndStop(1);
film.stop();
film.loadMovie(“001.swf”);
} else {
but1OnOff = false;
but1.gotoAndStop(1);
}
};
but2.onPress = function() {
if (but2OnOff == false) {
but2OnOff = true;
but1OnOff = false;
but3OnOff = false;
but2.gotoAndStop(2);
but1.gotoAndStop(1);
but3.gotoAndStop(1);
film.stop();
film.loadMovie(“002.swf”);
} else {
but2OnOff = false;
but2.gotoAndStop(1);
}
};
but3.onPress = function() {
if (but3OnOff == false) {
but3OnOff = true;
but1OnOff = false;
but2OnOff = false;
but3.gotoAndStop(2);
but1.gotoAndStop(1);
but2.gotoAndStop(1);
film.stop();
film.loadMovie(“002.swf”);
} else {
but3OnOff = false;
but3.gotoAndStop(1);
}
};
:q:
system
March 24, 2003, 6:31pm
7
hi playamarz,
just to keep you on track: this is what i make of your script-hint:
now i have some mouseover-effect also…
_root.onLoad = function() {
but1OnOff = false;
but2OnOff = false;
but3OnOff = false;
};
but1.onRollOver = function() {
if (but1OnOff == false) {
but1.gotoAndStop(2);
} else {
but1OnOff = true;
but1.gotoAndStop(2);
}
};
but1.onRollOut = function() {
if (but1OnOff == true) {
but1.stop();
} else {
but1OnOff = false;
but1.gotoAndStop(1);
}
};
but1.onPress = function() {
if (but1OnOff == false) {
but1OnOff = true;
but2OnOff = false;
but3OnOff = false;
but1.gotoAndStop(2);
but2.gotoAndStop(1);
but3.gotoAndStop(1);
film.stop();
film.loadMovie(“001.swf”);
} else {
if (but1OnOff == true) {
but1OnOff = true;
} else {
but1OnOff = false;
but1.gotoAndStop(1);
}
}
};
and so on …
maybe you have some improvements…
thanks again