Archive for February 17th, 2006

Changing text color on mouseEnter

When people first begin learning Lingo it is very common to do things such as sprite(21).visible = 0 or member(155).color = color(200,0,0). However, it is always advantageous to create behaviors that don’t make use of “hard coded” numbers so that the behavior can be reused in the future without having to adjust the sprite or member numbers or names.

When I first started playing with Lingo my code was full of these hard coded things. Now when I look back at stuff from a decade ago it kills me. Of course, when under pressure I’ll slip in a few of those things at the very end of a project. I always wish I could avoid it, but time pressures often cause the brain to ignore reason.

On the Adobe Director Forum a question was raised about changing the color of text on a mouseEnter event without having to recode each behavior for different member numbers. A very simple way to do this is to write a behavior that allows you to choose the color you want as you drop the behavior on each text member that you apply the behavior to.

Sample file: text_color_rollover.zip

Once you have written a good behavior, you end up using it for many years and many projects.

2 comments February 17th, 2006

Good sources for Director info?

What are your favorite source for info about Director? Where do you go when you need an answer on a tough Lingo question? Where do you go if you are just starting out with Director?

Tom Higgins posed the question on his blog, so get over there and let him know what you think.

Add comment February 17th, 2006


Director Sites

Calendar

February 2006
M T W T F S S
    Mar »
 12345
6789101112
13141516171819
20212223242526
2728  

Archives

Recent Posts

Recent Comments