Yep, right on both counts.
I don't know how you work but I like to have generic code snippets that I can adapt to different applications -the "rollover" part of that script was simply this:
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {}
... the rest of it is colour changing code which I could (and have) applied to clips changing if they've been hit in a game; duplicate movie clips where I don't want everything to look identical; slider controls etc.
So while it's overkill for an app like Scotty's the effort involved in putting it together was minimal 'cos I have it lying around, it's just an adaptation job.
Plus it's fun ;-)
And,as you know I like a challenge so here's the rollover you requested...
It's a "real" button inside a movieClip (you can't apply the Color() object to anything ther than an MC) so you get the hand cursor. The button is set to make the variable "hit" true on rollover and the clipEvent takes that and runs with it. I think that hitTest is probably a better way to go in this case because it's more accurate (if you rollOut really quickly the button doesn't go all the way back to it's original colour despite the movie having an incredibly high framerate).
Here's the swf:
Here's the script:
onClipEvent (load) {
// create object
buttonColour = new Color(this);
buttonTransform = new Object();
original = buttonColour.getTransform();
}
onClipEvent (enterFrame) {
// check button state
if (hit) {
// calculate mouse position
xDiff = _root._xmouse-_x;
yDiff = _root._ymouse-_y;
distance = Math.sqrt((xDiff*xDiff)+(yDiff*yDiff));
// calculate colour offset
buttonTransform.rb = Math.floor((_width/2-distance)*6);
} else {
buttonColour.setTransform(original);
}
// change colour
buttonColour.setTransform(buttonTransform);
}