Seems like the Flash people use native cursors to overcome this: 

http://stackoverflow.com/questions/293246/how-to-use-native-custom-mouse-cursors-from-within-flash-apps?rq=1
 

Ross Henderson's answer in the link above uses Colin Moock's CustomMousePointer 
class to solve this: 

http://www.moock.org/eas3/examples/moock_eas3_examples/eas3_custom_mouse_pointer/
 
which requires this class: 
http://www.moock.org/eas3/examples/moock_eas3_examples/eas3_stage_detector/src/StageDetector.as
 

When I try to implement I get an error: 

1067: Implicit coercion of a value of type flash.display:Sprite to an unrelated 
type mx.core:IVisualElement 

Following recommendations here, 

http://forums.adobe.com/thread/528185 

I tried to subclass the CustomMousePointer class as 
spark.core.SpriteVisualElement instead of Sprite, but while this compiles, it 
doesn't display the cursor. 

Any ideas how to convert this Flash example based on addChild() into Flex's 
spark using addElement()? 

----- Original Message -----

From: [email protected] 
To: "apache flex users" <[email protected]> 
Sent: Monday, October 21, 2013 11:58:00 AM 
Subject: using custom cursor leads to mouse lag on busy chart 

Hello, 

I've got a chart with a lot of data points on it. When the mouse enters this 
chart, a rollOver handler sets a crosshair cursor using 

[Embed("/path/to/crosshairCursor.png")] 
private var crosshairCursor:Class; 
... 
CursorManager.setCursor(crosshairCursor, CursorManagerPriority.HIGH); 

Note that this solution was based on the example from: 
http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f25.html
 

The problem is the crosshair cursor produces a very noticeable mouse lag when 
the user moves the mouse over the plot. If I use the default system cursor, the 
is no lag. 

Any ideas how to eliminate this lag? Seems to be related to the setCursor 
function. I just want to change the cursor, keeping everything else the same. I 
want to get the same performance as the default system cursor (e.g. pointer), 
but it seems not possible using the official approach to set a custom cursor. 


Reply via email to