PDA

View Full Version : Component Button - useHandCursor


dalar
03-12-2007, 08:22 AM
Hi all


I'm having a strange problem with buttons - bare in mind Im talking about buttons as components - from the componenets library...

I want the user's mouse to change to a hand sign (hand cursor), whenever their mouse is over the button... now by default, (at least on my system) all my 'component' buttons simply have the same standard pointer whenever the cursor is over them...

So far I have managed to solve this by:

myComponentButtonInstance.useHandCursor = true;

Now this seems to solve the problem, but I have many more buttons in my entire application, and this line will only alter the 'useHandCursor' property for just one instance of my buttons 'myComponentButtonInstance'.

Im pretty sure there is some sort of line of code I can put at the top of my actionscript file which will alter all future instances of the Component Button and set their useHandCursor property to true.

So far this is the only link I have found:
http://www.actionscript.org/forums/showthread.php3?s=&threadid=25934

But this talks about MovieClips??? ... remember that Im using a Button Component.

Thanks in advance! :)

mooska
03-13-2007, 09:23 AM
You can:

edit the mx.controls.SimpleButton class, line 518 useHandCursor = true;
then in you movie, import mx.controls.Button
in the first frame

dalar
03-14-2007, 02:56 PM
Hi

Thanks for taking the time to respond...

yes this is along the lines of what i am looking for ... but isnt there a way in actionscript where I could add a line after the 'import' statement which alters the useHandCursor property rather than editing the 'master button class' itself? ... just seems like a cleaner approach

so:


import mx.controls.Button
// line of code here which alters the button object useHandCursor propety

mooska
03-14-2007, 03:17 PM
True, it would be nicer, still I dont know any, and that one is good enough for me :)

Maybe someone else did this before. Personally I dont like components, maybe those in Flash9 will be nicer (They say so, and its only two weeks waiting for flash cs3 :) )