# 'Hit' State on a Movie Clip

**URL:** <https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708>\
**Category:** flash\
**Created:** [October 22, 2003, 6:23pm UTC](https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708 "2003-10-22T18:23:07Z")\
**Posts on this page:** 4\
**Page:** 2

<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:** [October 22, 2003, 8:11pm UTC](https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708/21 "2003-10-22T20:11:04Z")

</div>

“delete this.onEnterFrame” will simply stop the onEnterFrame, that is, it will stop doing the stuff in the enterFrame event handler.

Did you check out this thread? Then you don’t need the tween/animation at all . . .

[http://www.kirupaforum.com/forums/showthread.php?threadid=37455](http://www.kirupaforum.com/forums/showthread.php?threadid=37455)

Much simpler and cleaner.

---

<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:** [October 22, 2003, 8:13pm UTC](https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708/22 "2003-10-22T20:13:12Z")

</div>

Dude!

Kay check this out…

Original code for the MC:

on (rollOver) {  
gotoAndPlay (“2”);  
}  
on (rollOut) {  
gotoAndPlay (“9”);  
}

Revised Code for the MC:

on (rollOver) {  
this.gotoAndPlay (“2”);  
}  
on (rollOut) {  
this.gotoAndPlay (“9”);  
}

Final Outcome… IT WORKS!!! Do you know why?

---

<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:** [October 22, 2003, 8:15pm UTC](https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708/23 "2003-10-22T20:15:49Z")

</div>

LOL! Yeah, it works because you applied the action to an object, instead of just having the action floating in space. It’s like saying “go over there” instead of saying “Hey you! Yeah you! YOU go over there”.

Does that make sense? that’s the whole basis of flash really:

object.action = result!

Good job! 🙂

---

<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:** [October 22, 2003, 8:25pm UTC](https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708/24 "2003-10-22T20:25:54Z")

</div>

Hahaha! Good answer! But NO!!!

I had it the actionscript applied to the MC the whole time,… The only thing I added was the ‘This’. I didn’t think it would make a difference putting ‘This’ since the script was already applied to the MC! :ub:

Haha but Good Answer! 😉

[Previous page](https://forum.kirupa.com/t/hit-state-on-a-movie-clip/33708.md?page=1)
