First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Ptaczek

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.01 Votes: 168
(10 being the highest)
» Author
I'm just another webdesigner from Czech Republic ;) So sorry for the ugly english...
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

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

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.