flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurice Amsellem <maurice.amsel...@systar.com>
Subject RE:using custom cursor leads to mouse lag on busy chart
Date Mon, 21 Oct 2013 20:37:28 GMT
Why not just reading the asdoc on custom native cursors, and give them a try:

Mouse.registerCursor
MouseCursorData 

There are also associated examples

Maurice
________________________________________
De : modjklist@comcast.net [modjklist@comcast.net]
Envoyé : lundi 21 octobre 2013 22:15
À : users@flex.apache.org
Objet : Re: using custom cursor leads to mouse lag on busy chart

Perhaps this is a simpler method,

http://www.flashandmath.com/howtos/cursor/

but it still depends on addChild(). How to convert to addElement()?

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

From: modjklist@comcast.net
To: users@flex.apache.org
Sent: Monday, October 21, 2013 1:09:43 PM
Subject: Re: using custom cursor leads to mouse lag on busy chart

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: modjklist@comcast.net
To: "apache flex users" <users@flex.apache.org>
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.




Mime
View raw message