Simple problem

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

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:

[email protected]

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

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

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

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:

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

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?