You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by mo...@comcast.net on 2013/10/21 20:58:00 UTC
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.
Re: using custom cursor leads to mouse lag on busy chart
Posted by mo...@comcast.net.
Thanks for pointing out that Maurice, I didn't know those existed. I was able to get it working using this example:
http://corlan.org/2010/12/02/working-with-native-custom-cursors-in-flash/
Now the performance is really good. There's no lag in the mouse behavior.
----- Original Message -----
From: "Maurice Amsellem" <ma...@systar.com>
To: users@flex.apache.org
Sent: Monday, October 21, 2013 1:37:28 PM
Subject: RE:using custom cursor leads to mouse lag on busy chart
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" <us...@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.
RE:using custom cursor leads to mouse lag on busy chart
Posted by Maurice Amsellem <ma...@systar.com>.
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" <us...@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.
Re: using custom cursor leads to mouse lag on busy chart
Posted by Alex Harui <ah...@adobe.com>.
It should be as simple as replacing Sprites with SpriteVisualElement.
But you might find it easier to build out the cursor bitmap using
low-level Flash classes like Sprite and Shape and then addElement
shouldn't be a factor.
On 10/21/13 1:15 PM, "modjklist@comcast.net" <mo...@comcast.net> wrote:
>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-c
>ursors-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_p
>ointer/
>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" <us...@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/WS2db454920e96a9e51e63e3d11c0bf6908
>4-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.
>
>
>
Re: using custom cursor leads to mouse lag on busy chart
Posted by mo...@comcast.net.
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" <us...@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.
Re: using custom cursor leads to mouse lag on busy chart
Posted by mo...@comcast.net.
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" <us...@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.