Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flex 3: How can I change the Mouse Cursor when mousing over a Text Input?

In Flex, by default, when you mouse over a Text Input the mouse cursor is changed to the standard I cross bar. How can I change this cursor so the regular mouse pointer cursor is shown rather than the I cross bar?

update: Well, it seems this process is dirt simple in Flex 4 according to this blog post: http://blog.flexexamples.com/2008/11/03/setting-mouse-cursors-in-flash-player-10/

Since I'm stuck with Flex 3 for the time being, how can I do something similar?

update2: Also, this question is somewhat similar to this question: Avoiding cursor change over dynamic text fields in Flash CS3

Though, I am using the standard Flex Builder, not Flash CS3.

like image 677
DyreSchlock Avatar asked Apr 22 '09 19:04

DyreSchlock


People also ask

How do I change my cursor type while typing?

Change a single mouse cursor (Windows) In Windows 8, typing anywhere on the Start Screen brings up the search box automatically. In the Mouse Properties window that appears, click the Pointers tab. On the Pointers tab (shown below), select the mouse cursor you want to change in the Customize section.

How will you change the pointer icon when it goes over an a tag?

The default cursor for a hyperlink is "pointer". To change it, you need to specify the cursor type for your <a> element with the CSS :hover selector. In our example, we style only the "link" class.

How do I change my mouse's crosshair?

That said, you can open the Mouse Properties panel first and go to the Pointers tab. Then, select the Normal Select option, click the Browse button, and choose a crosshair cursor. Finally, click the OK button to save the change. That's all!


2 Answers

Just to clarify - the MouseCursor and Mouse classes exist also in Flex 3 on flash 10. So you can hook to the MOUSE_OVER and MOUSE_OUT events:

elem.addEventListener(MouseEvent.MOUSE_OVER, function(event:Event):void {
    Mouse.cursor = MouseCursor.BUTTON;
});

elem.addEventListener(MouseEvent.MOUSE_OUT, function(event:Event):void {
    Mouse.cursor = MouseCursor.ARROW;
});
like image 128
tm_lv Avatar answered Sep 22 '22 07:09

tm_lv


There are three properties that must be modified useHandCursor = true buttonMode = true mouseChildren = false

Leete more information this article http://www.anujgakhar.com/2008/03/27/flex-how-to-display-hand-cursor-on-components/

like image 37
Oscar Navidad Avatar answered Sep 20 '22 07:09

Oscar Navidad