# Moveclip Colide

**URL:** <https://forum.kirupa.com/t/moveclip-colide/23252>\
**Category:** flash\
**Created:** [June 15, 2003, 10:46am UTC](https://forum.kirupa.com/t/moveclip-colide/23252 "2003-06-15T10:46:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SBV](https://avatars.discourse-cdn.com/v4/letter/s/a88e4f/32.png) [@SBV](https://forum.kirupa.com/u/SBV)\
**Post date:** [June 15, 2003, 10:46am UTC](https://forum.kirupa.com/t/moveclip-colide/23252/1 "2003-06-15T10:46:10Z")

</div>

Do you know how to make movie clips change colour when you hit them with another movie clip?

E.g: I have a football, when it hits the goal, the goal changes colour.

Do i have to make a few frames on goal, 1st frame stop(); with normal goal and a few frames after with colours?

---

<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:** [June 15, 2003, 11:13am UTC](https://forum.kirupa.com/t/moveclip-colide/23252/2 "2003-06-15T11:13:22Z")

</div>

I would use this:  
[http://www.kirupa.com/developer/actionscript/hittest.htm](http://www.kirupa.com/developer/actionscript/hittest.htm)

you can tell a movieClip to do various things with the detection. I’m actually in the midst of learning it myself.

---

<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:** [June 15, 2003, 11:21am UTC](https://forum.kirupa.com/t/moveclip-colide/23252/3 "2003-06-15T11:21:53Z")

</div>

Well as you can see, it says it colides when it touches goal. Even though it is not actually touching the goal like the ball.

---

<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:** [June 16, 2003, 2:34pm UTC](https://forum.kirupa.com/t/moveclip-colide/23252/4 "2003-06-16T14:34:57Z")

</div>

I didn’t see much of a problem…The text changes when the ball hits the goal, or at least seems to. I don’t think I understand the problem.

---

<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:** [June 16, 2003, 3:10pm UTC](https://forum.kirupa.com/t/moveclip-colide/23252/5 "2003-06-16T15:10:12Z")

</div>

Play the game, you only score when the ball goes smaller and hits the goal… So i want the movie clip to go to a different keyframe when the ball actually goes IN the goal, not at same x and y co-ords.

---

<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:** [June 16, 2003, 11:50pm UTC](https://forum.kirupa.com/t/moveclip-colide/23252/6 "2003-06-16T23:50:21Z")

</div>

First of all, I can’t seem to score any goals - it stays at zero. Beyond the x and y coords and \_yscale being\<20, what do you mean by in? And if so, you would just add this code to your  
[AS]  
if (hitTest(\_root.ball )&& \_root.ball.\_yscale\<20 && \_root.time\>0) {  
\_root.score++;  
//this line:  
\_root.movieClip.gotoAndPlay(2);  
//the 2 can be either the frame number or name in " ".  
//etc…

```auto

Is that what you mean?
```
