# Please help me with rollovers

**URL:** <https://forum.kirupa.com/t/please-help-me-with-rollovers/3670>\
**Category:** programming\
**Created:** [November 5, 2001, 9:45pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670 "2001-11-05T21:45:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2001, 9:45pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/1 "2001-11-05T21:45:32Z")

</div>

Right… here’s the deal.  
I’m making a navagation for my site using flash, and am gonna use animated buttons.  
I have my animated buttons all in place on one layer, one Keyframe.  
What i wanna do is that the user rolls the mouse over the button, and then the movie goes to the frame which I want it to go, which will say something about the link.

E.g - User likes the look of “Bands” link. User puts mouse over it, and it takes the user to a frame saying about the link in a little box. User takes the mouse off the link, and it goes back to it’s original form.

I hope you understand. If you don’t - then I’ll try and provide an in-depth analysis in a later post if you wish me to.

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2001, 11:24pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/2 "2001-11-05T23:24:38Z")

</div>

onMouseEvent(roll over) go to which ever frame.  
onMouseEvent(roll out) go back to frame 1

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2001, 11:27pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/3 "2001-11-05T23:27:29Z")

</div>

have a variable (“loc”) for storing what section you’re in. say “info” is the name if the movie that contains the information that changes on rollovers.

```auto
 

on(rollover){
   info.gotoAndStop("links");
}

on(release){
   ... do going to links section stuff...
   _root.loc = "links";
}

on(rollout){
   if(loc != "links") _root.info.gotoAndStop(loc);
}

```

actually, you could put that if statement in all the actions.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2001, 8:24pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/4 "2001-11-06T20:24:18Z")

</div>

I’m sorry, but I don’t have a clue about Actionscipt, therefore have no idea what Variables are, and how to do them. Can you just explain how to do them, thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2001, 9:25pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/5 "2001-11-06T21:25:33Z")

</div>

we’re not talking rocket science here.

variables contain information so you can access it later on, you can store anything you want in .

name = “johannos”;

this way, your movie can remember things. cool!

cheers.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2001, 9:28pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/6 "2001-11-06T21:28:43Z")

</div>

So I just throw in that in the actionscript place?  
name = “bands”;

?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2001, 11:59pm UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/7 "2001-11-06T23:59:29Z")

</div>

yeah and then whenever you want to know what bands is you can reference it

\_root.content.gotoAndStop(name);

would send the movie clip “content” to a frame that you had labeled “bands”.

keep in mind that each movie holds it’s own set of variables so content.name will not be the same as \_root.name.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 7, 2001, 6:40am UTC](https://forum.kirupa.com/t/please-help-me-with-rollovers/3670/8 "2001-11-07T06:40:56Z")

</div>

AND keep in mind that the  
on (release){  
}  
command can only be placed on a button. If you open the action script panel, to add a/s, and the onMouseEvent(); option is grey’d out, then you do not have a button selected on the stage. If you try to add code it will be placed in the frame, rather than attached to the button instance.
