# MX Slide onEnterFrame question - help please

**URL:** <https://forum.kirupa.com/t/mx-slide-onenterframe-question-help-please/46949>\
**Category:** flash\
**Created:** [March 29, 2004, 8:07pm UTC](https://forum.kirupa.com/t/mx-slide-onenterframe-question-help-please/46949 "2004-03-29T20:07:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beanpie](https://avatars.discourse-cdn.com/v4/letter/b/48db29/32.png) [@beanpie](https://forum.kirupa.com/u/beanpie)\
**Post date:** [March 29, 2004, 8:07pm UTC](https://forum.kirupa.com/t/mx-slide-onenterframe-question-help-please/46949/1 "2004-03-29T20:07:36Z")

</div>

Welcome to my onEnterFrame nightmare.

OK, so I’m doing this tutorial, which is pretty straightforward, and I’ve got it to work so far. Here’s what it looks like:

on the main timeline:

stop();  
\_root.slidingObject\_mc.onEnterFrame = function() {  
if (\_root.running && Math.abs(\_root.marker\_mc.\_x-this.\_x)\<1) {  
this.\_x = \_root.marker\_mc.\_x;  
\_root.running = false;  
} else if (\_root.running) {  
this.\_x -= (this.\_x-\_root.marker\_mc.\_x)\*.5;  
} else {   
}  
};

on the buttons:  
on (press) {  
\_root.marker\_mc.\_x = 55;  
\_root.running = true;  
}

Here’s what I want to do and I’ve tried to write it a BILLION times and failed -

While running = true, I’d like the timeline of slidingObject\_mc to play.

While running = false, it should stop.

HOW DO I SAY THIS IN AS?!! It’s driving me totally NUTS! and, more importantly, once I’ve said it, where to I put it?! On the movie clip I want to play? On the main timeline? Argh!

Please help, I’m sure it’s a very simple question…

Thanks.

-B
