Scrolling images on rollover

Hi Everybody,

I have a scrolling image panel which works fine, but I’d like it to only scroll on rollover.

The script I have has onEnterFrame but it still rolls over wherever your mouse is.

Please could somebody help me modify my script so that it only works on rollover?

Many thanks,

Tom

Here’s the script:

onClipEvent (enterFrame) {
//movie clip enterframe event
_x = _x+2;
//change position for each enterframe event
if (_x>=2588) {
//condition
_x = -2588;
//if condition true movie clip jumps to starting postion.
}
}

So, let’s suppose your panel instance name is myPanel, go in the main timeline and put this code:


myPanel.onRollOver = function(){
this.onEnterFrame = function(){
this._x += 2;
if(this._x>=2588){
this._x =  -2588
}
}
}

It should work. But if your panel is a movieclip with other movieclip inside on which you rollOver, you might encounter other unpleasant situation: rolling over nested movieclips. If so, I could point you to a very useful tutorial that will help you solve it :slight_smile:

cheers…