03
Mar
08

Custom cursor API is a great solution for creating sets of custom cursors

Custom cursor API is a great solution for creating sets of custom cursors. Each set is a concrete class that you can set. In addition, you can implement custom events such as: mouse down, mouse up and custom busy cursor.

CursorManager class is useful for replacing the cursor with a custom cursor or for creating a busy cursor, but what do you do when you want to create a set of custom cursors? You may also be interested in building few sets of custom cursors to be used in different part of the application and keep track of them in one centralized location.
For example you want to create couple of sets of cursors. One of them will be a custom image, the cursor will change on mouse down and mouse up events and the cursor will have a custom busy image. That set will be used in one component and another set will be used in a different component.

Custom cursor API is based on creating custom sets of cursors for usage in an application. You create a concrete class and set all the images, swf or sprite objects you want to assign to that set and the cursor will change according to how you set it in the concrete class.

All source code contained in this API has been published under the MIT licence and is protected as stated therein.

To see an example and download source code:
http://elromdesign.com/blog/Flex/API/Cursor/

To view the ASDOC of the API:
http://elromdesign.com/blog/Flex/API/asdoc/

Cursor UML Class diagram


5 Responses to “Custom cursor API is a great solution for creating sets of custom cursors”


  1. 1 ajay kumar Jan 7th, 2009 at 4:00 pm

    Hi, would you please tell me that how can i design busy cursor for flex .

    Thanks

  2. 2 guillaume Feb 11th, 2009 at 8:51 am

    hi, and thank you for this API, which to be exactly what I need.
    Though, in your example’s souce code, there no url pointing on the external PNGs anywhere, so I don’t understand how the script get those images…

    I hope you’ll find time to clear this up for me =)

  3. 3 elad.ny Feb 11th, 2009 at 9:17 pm

    Every concrete class such as: ConcreteMouseDrop includes the URL to the PNG, for instance:

    [Embed(source="assets/curosr/images/mouse2_1.png")]
    public var cursorClass1:Class;
    [Embed(source="assets/curosr/images/mouse2_2.png")]
    public var cursorClass2:Class;
    [Embed(source="assets/curosr/images/mouse2_3.png")]
    public var cursorClass3:Class;

    You can view the example and right click to view the source code from here:
    http://elromdesign.com/blog/Flex/API/Cursor/

    I hope that helps…

  4. 4 Einar Gerdsen May 20th, 2009 at 10:02 am

    Just a heads up: in Flash Player 10 and Firefox it seems that the system cursor is shown onRelease and not removed until the cursor moves.

  5. 5 elad.ny May 20th, 2009 at 1:26 pm

    Hi Einar, the classes weren’t tested or changed since March 08 FP9, in case you get a chance to update plz do send me the code.