# ButtonMC qustion for da scripterz

**URL:** https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076
**Category:** flash
**Created:** [April 1, 2003, 3:32am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076 "2003-04-01T03:32:42Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Ayanami](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@Ayanami](https://forum.kirupa.com/u/Ayanami)
#### Post date: [April 1, 2003, 3:32am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/1 "2003-04-01T03:32:42Z")

</div>

Ok, I know I posted something like this the other day, but I figured out the solution. Now I have a question that experienced scripters might be able to answer for me.

When the mouse rolls onto the clip, the animation plays. When it rolls off, it plays. However, if the user moves off before either animation is finished, the results are less than desireable. I’m thinking I need some sort of test or anything like that. I’ve thrown up the .fla and if anyone can help me out, many thanks to you 🙂

peace

ayanami

---

<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: [April 1, 2003, 5:05am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/2 "2003-04-01T05:05:30Z")

</div>

You can use hitTest, I modified your button using hitTest, I hope that’s what you’re looking for. =)

---

<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: [April 1, 2003, 5:09am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/3 "2003-04-01T05:09:56Z")

</div>

nay, eg, this makes more sense:

i hope you follow my drift:

on the button:

[AS]on(rollOver){  
\_root.turn = true;  
}

on(rollOut, dragOut){  
\_root.turn = false;  
}[/AS]

on frame one of the timeline:

[AS]fscommand (“fullscreen”, “false”);  
fscommand (“allowscale”, “false”);  
stop();

//dont use Hand Cursor  
box.useHandCursor = false;

//handle the turn Function  
box.onEnterFrame = function(){  
if(turn){  
this.nextFrame();  
}else{  
this.prevFrame();  
}  
};[/AS]

This is an If/Else statement that tells the movie clip box to advance to the next frame of the movie as long as the user’s cursor is on the box, then play in reverse as soon as the cursor is off of the box.

I think that mine is much simpler to understand.

Pick mine! Pick Mine! JK…

---

<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: [April 1, 2003, 5:10am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/4 "2003-04-01T05:10:37Z")

</div>

sorry here’s the .fla :

---

<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: [April 1, 2003, 5:13am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/5 "2003-04-01T05:13:01Z")

</div>

liam, hahah that’s the same thing as the hitTest I used, your method just requires more scripting.

Either way, they both work. 😛

---

<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: [April 1, 2003, 5:14am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/6 "2003-04-01T05:14:15Z")

</div>

yeah but for someone who is new to scripting it could be easier to understand than a hitTest…

---

<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: [April 1, 2003, 5:36am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/7 "2003-04-01T05:36:57Z")

</div>

liam: hitTest is more accurate than rollOver and rollOut, so TECHNICALLY the hitTest method is better, but it depends on the situation. It is good to know both methods.

---

<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: [April 1, 2003, 6:31am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/8 "2003-04-01T06:31:59Z")

</div>

nice, thanks EG. that’s exactly what I was looking for. hehe, when i was looking for a solution, i found a post you put up for someone else with similar coding and i modified it a bit. i got it working like 10 mins before i came back here. 🙂 thanks everyone

peace

ayanami

---

<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: [April 1, 2003, 9:49am UTC](https://forum.kirupa.com/t/buttonmc-qustion-for-da-scripterz/17076/9 "2003-04-01T09:49:46Z")

</div>

no problem, glad it worked for you. =)
