If you have your own tutorials or open source and would like to share your Director knowledge please send them to info@shocksites.com. We will review them, post it and give full credit to the developer.
Current Open Source and Tutorials

Complete Guide to Cursors
Provided by Adam Montandon


IcePhoenix posted a request in the tutorial forum because he couldn't find a site with a complete guide to using cursors in Macromedia director. So I decided to write a definitive guide and place it on Stormsky. There are plenty of cursor tutorials on the web, but I am to teach you everything you wanted to know about cursors! Did you know that there are 28 extra cursors that Macromedia don't tell you about? Lets get started.

There are 2 types of cursors in Director
1) Built In Cursors
2) Custom Cursors

Both are very easy to use.

Built In Cursors
To use a Built In cursor the code always looks like this:

cursor 2

Simply, the word "cursor" followed by a number.
The table below shows you what numbers refer to what cursor. Sometimes the Mac has slightly different cursors to those on a PC. If there is an alternative Mac cursor it is shown on the right.

Cursor -1

cursor 1

cursor 2

cursor 3

cursor 4

cursor 254

cursor 256

cursor 257

cursor 258

cursor 259

cursor 260

cursor 261

cursor 271

cursor 272

cursor 280

cursor 281

cursor 284

cursor 285

cursor 286

cursor 290

cursor 291

cursor 292

cursor 293

cursor 294

cursor 295

cursor 297

cursor 298

cursor 299

cursor 300

cursor 301

cursor 302

cursor 303

cursor 304

 

cursor 200 --(NOTE: This is an INVISIBLE cursor)

 

The most useful cursor by far is cursor 200 because it is totally invisible, so if you are doing a presentation or showing a video and you want the cursor to disappear, you just use cursor 200 and when you want it to reappear, use cursor -1 I bet you didn't know it was so easy!

Custom Cursors
Next, lets get on to the second kind of cursors, Custom cursors. These are cursors you make yourself.

You can use just about anything you want as a custom cursor, a graphic, a photograph, a flash movie, even a video (although I'd recommend you stick to regular bitmaps for best results)

First, design your cursor and import it into director.
Next, put it in the highest sprite channel you have (this allows it to appear above all your other graphics.

Next, you'll add this behaviour and drop and drag it onto the sprite you want to use as a custom cursor:

property spritenum
on enterframe me
  cursor 200
  sprite(spritenum).loc = the mouseloc
end

What does this code do?
First, it turns off your cursor ( Cursor 200)

Then it takes the sprite, and sets its Loc to wherever the mouse is (mouseloc).

Here are some examples of cool things you can do with cursors:

This is a custom cursor that animates.

This example has 3 custom graphics following the mouse, the cross section follows both the mouseh and the mousev where as the other two arrows (up and down) only follow the mousev and mouseh respectively.

Another kind of custom cursor
Mahesh Menon e-mailed me with a way to make another kind of custom cursor, so I have included it here for the sake of completeness.


Make a bitmap with dimensions 16x16 or 32x32 and 8 bit depth.
1) Go to Insert >Media Element > Cursor
2) Select the cast that has the cursor bitmap member
3) Click on '<' and '>' to browse through the cast members (only those that
fit the above creteria will be shown)
4)Click on the 'Add' Button to make a cursor out of the selected cast member.
Note: More than one cast member can be added to make an Animated cursorIn order to use the custom cursor use the lingo:
cursor member("the cursor member name")
or
sprite(me.spriteNum).cursor = "the cursor member name"
or simply
cursor member("myCursor")

Note:Remember this type of custom cursor has a small problem, it 'pulsates' or 'blinks' when on top of 'flash sprites', 'Flim loop' and some 'Digital videos' and when you jump from one movie to another, during the transition period, the custom cursor is replaced with the default cursor. (Macromedia is aware of these problems)