Free Open Forum Is now Closed Track the Mouse Cursor in Flash using Action Script 3
Nov 052009

Today I was attempting to make a movie clip that would fade in on rollover and fade out on rollout.  The problem that I had, however, was that there are buttons placed inside this mc, and if you in turn mouse over them, it causes the whole thing to quickly fade out/in all over again – for whatever reason – making a blinking mess.

Anyway, after a rather frustrating search across google, I came across some interesting information.  There is, now, in AS3, a property called Mouse.cursor, and using it, along with event listeners, you can force the mouse cursor to be whatever you want it to be!

It has a total (that I know of) number of five different properties: ibeam, hand, arrow, button, and auto, and is formed as such:

Mouse.cursor = “ibeam”;
Mouse.cursor = “hand”;
Mouse.cursor = “arrow”;
Mouse.cursor = “button”;
Mouse.cursor = “auto”;

And you would put whichever one you need inside your rollover event listener.  Be sure to set it back to auto after you roll out, otherwise you could end up with a very confusing UI experience!

Hope this helps someone!

/A\V/

Posted by Alexander Tagged with: , ,

Leave a Reply

(required)

(required)