# Play movie on mouse position

**URL:** https://forum.kirupa.com/t/play-movie-on-mouse-position/5070
**Category:** flash
**Created:** [August 30, 2002, 10:58am UTC](https://forum.kirupa.com/t/play-movie-on-mouse-position/5070 "2002-08-30T10:58:58Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cuppaz](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@cuppaz](https://forum.kirupa.com/u/cuppaz)
#### Post date: [August 30, 2002, 10:58am UTC](https://forum.kirupa.com/t/play-movie-on-mouse-position/5070/1 "2002-08-30T10:58:58Z")

</div>

I have a movie clip which fades in and out containing navigation. I want to play the movie so that it ghosts in when the mouse is over it. I also want for it to fade out when the mouse goes out of the area of the movie clip. I have written the following code which i have paced on the timeline. I cant get it to work. Could any of you flash genui help.

if (\_root.\_ymouse \< 70 and \_root.\_ymouse \> 220) {  
\_root.artmenu.gotoAndPlay(“2”);  
} else if (\_root.\_ymouse \>70 and \_root.\_ymouse\<220) {  
artmenu.gotoAndPlay(“17”);  
}

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: [August 30, 2002, 11:13am UTC](https://forum.kirupa.com/t/play-movie-on-mouse-position/5070/2 "2002-08-30T11:13:15Z")

</div>

are you looping through this code? ie is there something which makes the main play head continually hit the frame that contains this code? If not… it will only be checking the location once.

I would suggest this

on the movie clip itself place this

OnClipEvent(mouseMove){  
if (trip) {  
this.gotoAndPlay(“2”);  
} else if (!trip) {  
this.gotoAndPlay(“17”);  
}  
}

then on the button I’d put this.

on(rollOver){  
\_root.artmenu.trip=true;  
}  
on(rollOut){  
\_root.artmenu.trip=false;  
}

or is there a specific reason why you need to use coordinates to do it. (I have run into a couple in my time)

---

<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: [August 30, 2002, 11:43am UTC](https://forum.kirupa.com/t/play-movie-on-mouse-position/5070/3 "2002-08-30T11:43:01Z")

</div>

artmenu is a movie clip containing several buttons for navigation not a single button. Sory if i did not explain my self clearly. Exactly what I want to do is when the mouse is in the area of the movie clip defined by co-ordinates it goes to frame 2 of the movie clip and plays. When the mouse is outside the area of the movie it goes to frame 17 and plays. I hope someone can still help.

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: [August 30, 2002, 11:45am UTC](https://forum.kirupa.com/t/play-movie-on-mouse-position/5070/4 "2002-08-30T11:45:43Z")

</div>

like david said… if you don’t need to use coordinates… I’d use something like this:

```auto

onClipEvent (load) {
	this.useHandCursor = false;
}
on (rollOver) {
	this.gotoAndPlay(2);
}
on (rollOut) {
	this.gotoAndPlay(17);
}

```

simple and effective. hope that helps…

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: [August 30, 2002, 11:47am UTC](https://forum.kirupa.com/t/play-movie-on-mouse-position/5070/5 "2002-08-30T11:47:10Z")

</div>

sorry… we posted at the same time… :-\
