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, "[email protected]" <[email protected]> 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: [email protected] >To: [email protected] >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: [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/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. > > >
