Small mc scrolling question

HI guys my first post take it easy on me,hehe :slight_smile: I made a thumbnail mc and Im scrolling it with the code below Im wondering how to keep the mc from scrolling forever? thank you.

onClipEvent(enterFrame)
{
if(hitTest(_root._xmouse, _root._ymouse, true))
_root.base.slider._y -= 10
}

Iā€™m not entirely sure, but I think this is what you mean. Place this on your main timeline. Iā€™m calling the movieclip on which you placed your code mc here.

[AS]
mc.onEnterFrame = function(){
if(hitTest(_xmouse, _ymouse, true)){
_root.base.slider._y -= 10
}
if (_root.base.slider._y <= 20){
delete _root.mc.onEnterFrame
}
}
[/AS]

That should stop slider when it reaces _y value of 20. It will only move up when rolled over, I worked from your existing code.

I have my above code on a mc (button) and on mouse over it scrolls my mc (slider)I dont think I can put that on the main timeline Thanks ?

What are trying to achieve ? On rollOver of that button you want slider to start sliding and to stop at a certain y value ?

yes I have it scrolling perfect with the above script but it will scroll on forever if the mouse is on top of the up or down button I would like it to start and stop on a certain value?

Is this what you wanted ?

exactly thanks so much I will learn from that much thanks Voet. :slight_smile:

Glad I could help :s: