Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rollovers

Status
Not open for further replies.

z35

Programmer
Dec 21, 2001
206
US
Hi,

I have a simple question. In frame number 5 of my movie clip's timeline, I have a 2 buttons. When you rollover the button, I want a picture to appear. when you roll out, it should disappear. when you press, it should stay....until you roll over the next button. How can I do this? Is it even possible?

...remember, the buttons are inside a movie clip.

Please give me any ideas you have...thanks.
soumya
 
Hi,

Here's how I would do it

Create 2 new movieclips. Name them pic1 and pic2.
In both of these movieclips label the first frame "normal" and put a stop(); action in it.

Label the second frame "over", place your picture in it and put a stop(); action in it.

The code you put in your first button is:

on (rollOver) {
_root.pic1.gotoAndStop ("over");
_root.pic2.gotoAndStop ("normal");

}
on (rollOut) {
_root.pic1.gotoAndStop ("normal");
}
on (release) {
_root.pic1.gotoAndStop ("over");
}


code for the second button is:


on (rollOver) {
_root.pic2.gotoAndStop ("over");
_root.pic1.gotoAndStop ("normal");

}
on (rollOut) {
_root.pic2.gotoAndStop ("normal");
}
on (release) {
_root.pic2.gotoAndStop ("over");
}

regards, goaganesha
 
My way of tackling a similar problem followed the same lines as the above response.

Basically, create a new movieclip, in this case called "info", where your picture appears in a keyframe (in my case/this example) at frame 52. Put a stop action at say, frame 62.

On roll out, direct the FlashPlayer to frame 1 of your movieclip which in my case is empty, other than for a blank keyframe with a stop action.

The syntax from my movie is as follows. (Scene one (my main movie) frame 194 contains a getURL action to make the link work).

To summarize: Rollover - graphic appears, rollout - graphic disappears, keypress - return to main timeline, frame 194 which contains the getURL action.


on (rollOver) {
tellTarget ("_root.info") {
gotoAndPlay (52);
}
}
on (rollOut) {
tellTarget ("_root.info") {
gotoAndPlay (1);
}
}
on (release) {
gotoAndPlay ("Scene 1", 194);
}

Hope this helps.

Merry Christmas.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top