Articles Archive
Articles Search
Director Wiki
 

Cursors and behaviours

November 13, 1997
by Pat McClellan

Dear Multimedia Handyman
I have been using the Behaviors in D6, particularly the "UI Rollover and Mouse Down Pointer". I set it so that it changes to a Hand on rollOver and to the Closed Hand on mouseDown. Is there a way to set this as the default cursors for the behavior?

Signed,

Fingers Crossed

Dear Fingers,

You betcha. What you want to do is alter the code of the behaviors that came with Director. Easy to do, but I'd recommend making a copy of the Behavior & editing the copy... just in case.

Open the script to the behavior and find the on getPropertyDescriptionList handler. This is the section of every behavior which controls what will appear on the dialog box when you apply that behavior to a sprite. You want to change the #default values for 2 properties: #incursSet and #incursDownSet.

The numerical value for the Hand is 260, and the Closed Hand is 290. Your altered code should look like this (soft returns omitted for html):

#incursSet: [ #comment:   "Rollover Pointer Image:", ¬
  #format:    #cursor, #default:    260 ],

and

#incursDownSet: [ #comment:   "Mouse Down Pointer ¬
  Image:", #format:    #cursor, #default:   290],  

I have used this same procedure to set the default for the Pointer Change on Rollover behavior to the Finger (280). You can find the correct number by applying the behavior, selecting the desired value (Finger) in the pulldown menu, and then looking at the fine print in the Behavior Inspector for the sprite. The numerical value that you selected will be displayed as the value for the particular property.

This procedure has saved me lots of time by customizing the default values to ones that I use most often. It also got me interested in writing my own behaviors. I hope you'll take the time to explore writing behaviors for yourself. It's a great introduction to object oriented programming.

Also, be sure to check out Ren Feinstein's Lingo Behavior Database in DOUG's Resources section. It's chock-full of user contributed behaviors. And when you write one that you're proud of... send it in!

Patrick McClellan is Director Online's co-founder. Pat is Vice President, Managing Director for Jack Morton Worldwide, a global experiential marketing company. He is responsible for the San Francisco office, which helps major technology clients to develop marketing communications programs to reach enterprise and consumer audiences.

Copyright 1997-2024, Director Online. Article content copyright by respective authors.