# Rollover

**URL:** <https://forum.kirupa.com/t/rollover/183696>\
**Category:** Uncategorized\
**Created:** [March 29, 2006, 9:37am UTC](https://forum.kirupa.com/t/rollover/183696 "2006-03-29T09:37:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![martc](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@martc](https://forum.kirupa.com/u/martc)\
**Post date:** [March 29, 2006, 9:37am UTC](https://forum.kirupa.com/t/rollover/183696/1 "2006-03-29T09:37:56Z")

</div>

Your help is needed!! I want to create a menu which comes in from the side of the page when the mouse is placed over it. (When it is off the page it looks like a tab). To do this I used this code:

on (rollOver) {  
gotoAndPlay(2);  
}

on (rollOut) {  
gotoAndPlay(30);  
}

That works fine, the problem I’m having is putting buttons on the menu when it slides out. I have got the button as a symbol and put on this code:

on (release) {  
\_root.gotoAndPlay(“Products”);  
}

This normally would work but as it is on a rollover image then you click on it, it doesn’t work (you can see the button ok).

Any ideas on how i can do this or will I need to do something else other than a rollover. Cheers for any help (-: .

mart

---

<div class="post-metadata">

**Author:** ![kallisti](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kallisti](https://forum.kirupa.com/u/kallisti)\
**Post date:** [March 29, 2006, 9:55am UTC](https://forum.kirupa.com/t/rollover/183696/2 "2006-03-29T09:55:42Z")

</div>

maybe include the fla or a swf to preview?

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [March 29, 2006, 9:56am UTC](https://forum.kirupa.com/t/rollover/183696/3 "2006-03-29T09:56:59Z")

</div>

use,

```auto
onClipEvent(mouseDown){
if(this.hitTest(_root._xmouse, _root._ymouse, true)){
//action
}
}

```

because clipEvents are registered before on  
Though, you should use frame-based codes, see:  
[www.n99creations.com](http://www.n99creations.com)

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [March 29, 2006, 9:57am UTC](https://forum.kirupa.com/t/rollover/183696/4 "2006-03-29T09:57:42Z")

</div>

[http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics\_of\_actionscript\_for\_flash&p=1&l=Flash\_MX\_04](http://www.n99creations.com/?pID=tutorials&col=Blue&tut=basics_of_actionscript_for_flash&p=1&l=Flash_MX_04)

Exact link

---

<div class="post-metadata">

**Author:** ![martc](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@martc](https://forum.kirupa.com/u/martc)\
**Post date:** [March 29, 2006, 10:32am UTC](https://forum.kirupa.com/t/rollover/183696/5 "2006-03-29T10:32:33Z")

</div>

Thanks for the quick replys guys!! Here is a link to the site

[http://www.pensworth.co.uk/test/webtest.htm](http://www.pensworth.co.uk/test/webtest.htm)

I don’t know how to upload the actual .fla file to this forum:sure:

I have tried the code, but to no avail (to be honest i’m not too sure how to use it!).

Cheers!

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [March 29, 2006, 10:41am UTC](https://forum.kirupa.com/t/rollover/183696/6 "2006-03-29T10:41:59Z")

</div>

```auto

onClipEvent(mouseDown){
if(this.hitTest(_root._xmouse, _root._ymouse, true)){
//action
}
}

```

Put that on the items, then replace the “//actions” text to the action you want it to do

---

<div class="post-metadata">

**Author:** ![martc](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@martc](https://forum.kirupa.com/u/martc)\
**Post date:** [March 29, 2006, 10:48am UTC](https://forum.kirupa.com/t/rollover/183696/7 "2006-03-29T10:48:08Z")

</div>

It works!! Thanks mate! I put the code in before but as the products mc is text you had to click exactly on the text for it work work (solved with a transparant rectangle).:thumb:

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [March 29, 2006, 10:57am UTC](https://forum.kirupa.com/t/rollover/183696/8 "2006-03-29T10:57:18Z")

</div>

:player: Be sure to read my tut 😃

---

<div class="post-metadata">

**Author:** ![kitaeshi](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@kitaeshi](https://forum.kirupa.com/u/kitaeshi)\
**Post date:** [March 29, 2006, 3:20pm UTC](https://forum.kirupa.com/t/rollover/183696/9 "2006-03-29T15:20:02Z")

</div>

martc, how do u made ur site [http://www.pensworth.co.uk/test/webtest.htm](http://www.pensworth.co.uk/test/webtest.htm)  
to keep on repeating the image from left to right??? actionscript or just normal movie tweening. thxs

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [March 29, 2006, 8:11pm UTC](https://forum.kirupa.com/t/rollover/183696/10 "2006-03-29T20:11:12Z")

</div>

[www.n99creations.com](http://www.n99creations.com)  
in the archives, go to the chopper rescue game, the water does that 😉
