# Simple problem

**URL:** <https://forum.kirupa.com/t/simple-problem/4885>\
**Category:** Uncategorized\
**Created:** [August 23, 2002, 7:54pm UTC](https://forum.kirupa.com/t/simple-problem/4885 "2002-08-23T19:54:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ryall](https://avatars.discourse-cdn.com/v4/letter/r/53a042/32.png) [@Ryall](https://forum.kirupa.com/u/Ryall)\
**Post date:** [August 23, 2002, 7:54pm UTC](https://forum.kirupa.com/t/simple-problem/4885/1 "2002-08-23T19:54:35Z")

</div>

ok I am making an animation that has many different movie clips moving across a masked area at different speeds… when they hit a movie clip called ‘reset’ I want them to be moved back so many pixels and start the animation over again… here is the code I am using, it moves the clips fine but does not reset them with hitTest:

onClipEvent (enterFrame) {  
if (this.hitTest(\_root.reset)) {  
this.\_x = -200;  
} else {  
speed = 2;  
this.\_x += speed;  
}  
}

I know I am missing somehting really stupid - please help.  
Peace

---

<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 23, 2002, 8:41pm UTC](https://forum.kirupa.com/t/simple-problem/4885/2 "2002-08-23T20:41:22Z")

</div>

The code seems fine but I can mess with your .fla if you want, you can either private message me a URL or use my email:

[dan@macromotive.com](mailto:dan@macromotive.com)

---

<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 23, 2002, 8:56pm UTC](https://forum.kirupa.com/t/simple-problem/4885/3 "2002-08-23T20:56:57Z")

</div>

ahhh crap… I just removed the elements to put into a seperate .fla to post and it all works fine in there… errrrrr … I must be missing something in my origonal MC - ahhh I think I know what it is… I shouldnt put \_root.reset if the resetMC resides on the same time line within the movie clip? ahhh nope that didnt 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:** [August 23, 2002, 8:58pm UTC](https://forum.kirupa.com/t/simple-problem/4885/4 "2002-08-23T20:58:00Z")

</div>

Maybe you have more than one object with the same instance names?

---

<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 23, 2002, 9:00pm UTC](https://forum.kirupa.com/t/simple-problem/4885/5 "2002-08-23T21:00:36Z")

</div>

ok I got it to work: if I place the resetBlock on the main movie timeline with everything else happening in the MC it resets just fine… how can I make it so the reset block is in the MC and not on the main stage?

nope thats not the problem as far as I can tell

---

<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 23, 2002, 9:07pm UTC](https://forum.kirupa.com/t/simple-problem/4885/6 "2002-08-23T21:07:45Z")

</div>

Well select you ‘reset’ instance and cut it (control + x) and double click on your MC that you want to paste it in and make its own layer if you want and paste (control + v) and change you script to this since your reset instance is within the clip itself:

```auto
**onClipEvent (enterFrame) {
    if (this.hitTest([color=red]reset[/color])) {
        this._x = -200;
    } else {
        speed = 2;
        this._x += speed;
    }
}**

```

---

<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 23, 2002, 9:20pm UTC](https://forum.kirupa.com/t/simple-problem/4885/7 "2002-08-23T21:20:01Z")

</div>

I did all that and for some reason it is not working properly… oh well I found a work around - it doesnt really matter it is just frustrating that something so simple is giving me grief! Thanks for your input… actually there is somehting else, I am thinking about making the MCs that are moving be reset at random alpha values, and or y positions relative to my mask… what do you think the best way to do this would be?
