Monday, November 29, 2010

Move the object using the Action Script and cursor.

Step 13

Then, select again the cursor, open the Action Script Panel (F9), and paste this script:

onClipEvent (load) {
}
onClipEvent (mouseMove) {
xm = getProperty (_root, _xmouse );
ym = getProperty (_root, _ymouse );
setProperty("_root.cursor", _x, xm);
setProperty("_root.cursor", _y, ym);
}

onClipEvent (mouseDown) {
with (_root.cursor) {
gotoAndStop("clench");
}
}

onClipEvent (mouseUp) {
with (_root.cursor) {
gotoAndStop("open");
}
}

We're done!

Full Tutorial