Search Tutorials
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.
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 ! :)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|