Text Files

Look at the pencil cursor program.

Creating a custom cursor is something we might want to do in other programs. We can save the code for the pencil cursor in a text file, and then include it in other programs.

1
2
3
4
5
6
7
Mouse.hide();
addEventListener(Event.ENTER_FRAME, moveCursor);
myCursor.mouseEnabled = false;
function moveCursor(event:Event) {
   myCursor.x = mouseX;
   myCursor.y = mouseY;
}
CODE

If the flash file and the external code aren't in the same folder, include the path:

include "c:/myfiles/customcursor.as";

You could name the custom cursor myCursor, but you don't have to. The code below shows how to set something else to the custon cursor. This must be doe before you include the file.

1
2
var myCursor: MovieClip=myBrush;
include "customcursor.txt";
CODE
Get Adobe Flash player

NEXT: A list of names