Pick effect

Hello,

Does anyone know how to create an effect where if a person selects one button it becomes highlighted, whereas the others dim, and vise versa?

Thank you…

Use the over state of your buttons.

I think I wasn’t clear on my question. I don’t want the button to just become highlighted when I go over, but want it to stay highlighted when it is selected. Then, if another button is selected I want that to become highlighted, and the first to become dim again. Hope this is clear… sorry for any trouble.

Sorry, I kinda forgot this thread :stuck_out_tongue: This FLA should get you on the right track.

Uh, Voetsjoeba, I still don’t think that’s what he’s asking for. When the mouse goes over one button, the others dim. :hangover:

If I knew how to about this myself, something, I would help you. But I don’t so :sure: you’ll have to wait for other people.

I think I know what you mean. This is what I would do:
First, and I know you’re going to hate this, but I would use movieClips instead of buttons; because you can apply button commands to movieClips and it would make the animation better if you decide to use animation. Make all the movieClips you need - let’s say you need five. Make the five movieClips and make the dim state in frame one and the highlighted state on frame two. Be sure to put stop() actions on both frames of all the movieClips.
on the movieClips themselves, put actions like:


//this would be your first button
onClipEvent(enterFrame){
if(_root.buttonPressed==1){
this.gotoAndStop(2);   //highlighted
} else {
this.gotoAndStop(1);    //dim
}
}
on(press){
//in addition to whatever you have here
_root.buttonPressed=1;
}

Put this on all your movieClips and change the number ‘1’ accordingly. Last step, if you movie loads up and you want the first button to be highlighted (because it’s the first page - if this is a nav thing, that is) then on the main timeline, put:


buttonPressed=1;

See if that works for you. It works perfectly in my head, I’m not on a computer with Flash, but if you have any qs let me know.

I think what he wants is, when you click the button, the colour remains different from the ones that you havent click yet. So think its kind a marked that you have already click that particular button.

Im not really sure. but i think thats what he want

wow, thank you all for the help, it will take me some time to go thru all the supplied material to see if any of it works…

just to further clarify, what I want is what crazysniper22 has written…

*Originally posted by something369 *
**Does anyone know how to create an effect where if a person selects one button it becomes highlighted, whereas the others dim, and vise versa? **

Isn’t that what my FLA does ? But anyways, let me read crazysniper’s post …

*So you want it to stay highlighted when you click ? Clicking is not selecting :wink: But, do you want the mark removed when another button is clicked ?

Freddythunder’s solution actually works.

I implemented his codes and this is what I got. (check out the attachment)

What I did was to use the color red for the dim color and orange as the highlighted one. (you canjust change the colors to your whim)

you might want to use on release to initial other actions but Freddy’s code seems to work just fine.

Hope this helps.

mabuhay ang Pinoy!:wink:

  • Freddy

Your code uses onEnterFrame, while it can be perfectly done without. No offence Freddy, the onEnterFrame might cause framyness, especially when you use this in a navigation.

Try this FLA.

Hi Voetsjoeba

I have attached movieclips on the buttons that you have created in your pickeffects2.fla.

Would you know of a way for the animation to kick-in as soon as the entire clip is loaded and how can I make it reload using onClipEvent?

This would be probably easier (and better :beam: )

// you keep an array with all the names of your buttons (which are in fact clips)
myButtons = ["but1", "but2", "Paul", "Pom"] ;

// you define the onPress event for each button in a loop since they all do the same
for (var i=0; i < myButtons.length; i++) {
myButtons*.onPress = function () {
// the _alpha of the pressed button is set to 100
this._alpha = 100 ;
// all the other to 50
for (var j=0; j < myButtons.length; j++) {
if (myButtons[j] != this) myButtons[j]._alpha = 50 ;
}
}
}

Untested, but that’s the idea :slight_smile:

Just a little thing…
[AS]myButtons = [but1, but2, Paul, Pom];[/AS]
Don’t put the names in the array as strings.