Image Viewer

I built an image viewer using AS 2.0. The stage contains a movieclip (“slides”) which contains a series of images all of which are buttons that link to outside URLs. ‘Slides’ is supposed to move with the mouse. So when the mouse is all the way to the right, the right-most image should be showing. I hope that makes sense.

I’m only have a basic understanding of flash and actionscript so I followed a tutorial for the math and code involved and tweaked it to what I needed. The strange part is, I had it working perfectly, then added a few more images and now it has issues. Only the right half of the viewer responds to the mouse. The left half does nothing… I’m not sure what to do because as far as I know, nothing is different than the one that was working…

Code:

leftMouse = mask_mc._x;
rightMouse = mask_mc._x + mask_mc._width;

leftClip = mask_mc._x;
rightClip = mask_mc._x + mask_mc._width - slides._width;

slides.onEnterFrame = function()
{
var rx = (_root._xmouse - leftMouse)/(rightMouse - leftMouse);
rx = Math.max(0, Math.min(1, rx));
var dx = leftClip + (rightClip - leftClip)rx;
this._x += (dx - this._x)
.2;
this._y += (dy - this._y)*.2;
}
Thanks :slight_smile:
Andy