# MovieClip interaction - help please

**URL:** https://forum.kirupa.com/t/movieclip-interaction-help-please/117985
**Category:** Uncategorized
**Created:** [August 1, 2004, 7:29pm UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985 "2004-08-01T19:29:57Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ben\_is\_sparky](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_is_sparky/32/664_2.png) [@ben\_is\_sparky](https://forum.kirupa.com/u/ben_is_sparky)
#### Post date: [August 1, 2004, 7:29pm UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985/1 "2004-08-01T19:29:57Z")

</div>

Sorry, this is probably very easy but:

How can I make it so that when one movieclip touches or goes near (preferable) another, it will advance to the next frame of the movieclip.

This is probably easier to explain if I say what I’m trying to do.

Spaceship flies around (mc) when it his an asteroid (another mc), the asteroid explodes

Thanks, Ben

---

<div class="post-metadata">

### Author: ![attuned](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/attuned/32/648_2.png) [@attuned](https://forum.kirupa.com/u/attuned)
#### Post date: [August 1, 2004, 9:10pm UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985/2 "2004-08-01T21:10:27Z")

</div>

[http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=flash+mx+collision+hittest+tutorial](http://www.google.com/search?hl=en&lr=&ie=UTF-8&q=flash+mx+collision+hittest+tutorial)

---

<div class="post-metadata">

### Author: ![Goth\_Santa](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Goth\_Santa](https://forum.kirupa.com/u/Goth_Santa)
#### Post date: [August 1, 2004, 11:06pm UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985/3 "2004-08-01T23:06:56Z")

</div>

> [@ben\_is\_sparky](#):
>
> Sorry, this is probably very easy but:
> 
> How can I make it so that when one movieclip touches or goes near (preferable) another, it will advance to the next frame of the movieclip.
> 
> This is probably easier to explain if I say what I’m trying to do.
> 
> Spaceship flies around (mc) when it his an asteroid (another mc), the asteroid explodes
> 
> Thanks, Ben

The best way is probably good ol’-fashioned **hittest** :

```auto

 // put this in the spaceship's code
 if (hitTest(_root.asteroid) == true) {
 	tellTarget (asteroid) {
 		  gotoAndPlay (first frame of explosion animation);
 	}
 }
 

```

The only thing to watch out for is to make sure you get the relative location of the objects right, i.e. \_root.asteroid, or whatever. Hope this helps.

---

<div class="post-metadata">

### Author: ![ben\_is\_sparky](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_is_sparky/32/664_2.png) [@ben\_is\_sparky](https://forum.kirupa.com/u/ben_is_sparky)
#### Post date: [August 2, 2004, 7:37am UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985/4 "2004-08-02T07:37:37Z")

</div>

I tried this code and it said id needed an onClipEvent thing. I looked around the tutorials and forums and put one in but it still doesn’t work.

Could it be because I have other code attatched to the spaceship (to control it)?

Here is my .fla

Thanks  
Ben

---

<div class="post-metadata">

### Author: ![NovemberRain](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@NovemberRain](https://forum.kirupa.com/u/NovemberRain)
#### Post date: [August 2, 2004, 8:21am UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985/5 "2004-08-02T08:21:18Z")

</div>

Hi,  
I’ve made some little correction on the script and upload it again for you. You didn’t add quotes for the passing framelaber ie… gotoAndPlay (exploid);

Some other modificitons also made. check out  
Try try until you reach that is the Mantra. :battery:

---

<div class="post-metadata">

### Author: ![ben\_is\_sparky](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_is_sparky/32/664_2.png) [@ben\_is\_sparky](https://forum.kirupa.com/u/ben_is_sparky)
#### Post date: [August 2, 2004, 9:30am UTC](https://forum.kirupa.com/t/movieclip-interaction-help-please/117985/6 "2004-08-02T09:30:55Z")

</div>

Thank you very much  
Thanks and Thank you again

I could go on all day but I won’t because i need to look at this
