This is a generic bit of code that is from a mouse tutorial I wrote for VC++. With some changes, it now works in Flash MX.
Just add this code to the first keyframe on your main movie timeline and set your movie background to be black.
Let me know if you think it's neat or not, I like it. Just run it, then click and drag your mouse around the screen.Code:_root.onMouseDown = function()
{
_root.draw = 1;
newX = _root._xmouse;
newY = _root._ymouse;
moveTo(newX, newY);
}
_root.onMouseUp = function()
{
_root.draw = 0;
}
_root.onMouseMove = function()
{
if (draw)
{
oldX = newX;
newX = _root._xmouse;
oldY = newY;
newY = _root._ymouse;
lineStyle(8, 0xFFFFFF);
lineTo(newX, newY);
}
updateAfterEvent();
};
Spyder
Here's a link to a finished version of it:
http://perfectweb.org/chalkboard.html
[Edited by NetSpyder101 on 03-16-2002 at 09:41 AM]