Step 3 - Frame Actions (functions)
We will use a functions for cursor updating, because function can be called independently on framerate.
I always define the global functions in the 1st frame of action layer. The calling of such functions is easy
and the coding is clear and well sctructured.
Bring-up the frame actions editor by double-cliking on 1st frame in actions layer and enter this code:
stop();
/* update the cursor coords */
function updateCursor() {
_root.cursor._x = _xmouse;
_root.cursor._y = _ymouse;
updateAfterEvent();
}
The _root.cursor._x = _xmouse; and _root.cursor._y = _ymouse; just updates the cursor's X and Y coordinates according to mouse position. But the main trick is in the updateAfterEvent(); function. This one is neccessary for smooth cursor movement. With this function the cursor movement will be smooth and independent on the swf's framerate ! :)
| » Level Advanced |
|
Added: 2002-01-11 Rating: 9 Votes: 167 |
| » Author |
| I'm just another webdesigner from Czech Republic ;) So sorry for the ugly english... |
| » Download |
| Download the files used in this tutorial. |
| Download (85 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!