View Full Version : Button help
maria24
01-05-2011, 08:33 PM
Hello,
I have created buttons with up/over/down states. The button changes colour during the over/down frames.
How do I keep the over or down state active until the user clicks another button?
Right now when the user puts the mouse over the buttons, they change colour, but it goes back to the original colour once they click off. I would like it to remain on the changed colour so that the user remembers which button s/he's pressed until the another one is clicked.
Thanks for the help.
hansolo
01-06-2011, 11:17 AM
change btn once clicked to half transparent .
btn1.onPress = function(){
// half transparent
this._alpha 50;
}
Thats simple.
Edit the button and on the Down keyframe change the alpha of the button to 50%
maria24
01-07-2011, 12:21 AM
Thanks for your help! I will give those a try.
maria24
01-07-2011, 12:35 AM
hansolo, I tried the following code
btn1.onPress = function(){
// half transparent
this._alpha 50;
}
Used actionscript3 but getting a 1084:Syntax error: expecting rightbrace before 50.
And Lcva...
sorry for the ignorance, but when I double-click the button to access the Up, Over, Down, Hit keyframes, how do I access the alpha property in the Down keyframe?
I only seem to have access to alpha in the Properties window when I click on the button, but not when I double-click to enter the Down keyframe.
Thanks for the help.
maria24
01-11-2011, 04:55 PM
Hello,
I came up with the following code in actionscript 3 and got it to partially work:
btn1.addEventListener(MouseEvent.MOUSE_UP, startTransparent)
function startTransparent (e:MouseEvent):void{
btn1.alpha = .6;
}
So when it's in the down state, I get the transparent state and stays there. But how do I get it back to normal when the user clicks on another button? I'm stumped on that part of the script.
Any help would be greatly appreciated.
maria24
01-13-2011, 03:10 PM
Hello,
Still stuck with the problem below. I've tried numerous things and can't get it to work. Driving me nuts.
Once I've got it on the transparent state, how do I get the button to go back to the original normal state when the user moves on to click another button?
Help would be so greatly appreciated. Thanks!
hansolo
01-29-2011, 08:02 PM
sorry its on the rollover this will stay transparent. Now set up an if statemtn
btn1.onRollover = function(){
// half transparent
btn1._alpha = 50;
// make the over two btns opaque
btn2._alpha =100
btn3._alpha =100
}
btn2.onRollover = function(){
// half transparent
btn2._alpha = 50;
// make the over two btns opaque
btn1._alpha =100
btn2._alpha =100
}
// now a way to do this is to say if rollover btn1 make the other two btns not transparent.
or do when the user click the btn.
btn1.onPress = function(){
// half transparent
btn1._alpha = 50;
// make the over two btns opaque
btn2._alpha =100
btn3._alpha =100
}
btn2.onPress = function(){
// half transparent
btn2._alpha = 50;
// make the over two btns opaque
btn1._alpha =100
btn3._alpha =100
}
btn3.onPress = function(){
// half transparent
btn3._alpha = 50;
// make the over two btns opaque
btn1._alpha =100
btn2._alpha =100
}
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.