You must login before being able to do this action

Haxe Forum > Flash(10.2) native mouse cursor bug

  • I wanted to use some bitmap for native mouse cursor in flash (it's a 10.2 feature), but the flash.ui.Mouse lib is not correct even in r3793 version.
    Compared with Adobe's documentation there are 2 differences:

    1. Mouse.cursor's type is not MouseCursor, instead of String. But in Haxe this is not a good solution, because we need both of them, to switch to native cursor (String) and switch back to windows cursor (MouseCursor). So I use now like Dynamic, and it works both way. (I don't know how can I set a variable into two types.)

    2. Mouse.registerCursor function needs two parameters: (name:String, cursor:MouseCursorData) and not one.

    So here is the corrected Mouse.hx:

    package flash.ui;
    
    extern class Mouse {
        @:require(flash10) static var cursor : Dynamic;
        @:require(flash10_1) static var supportsCursor(default,null) : Bool;
        static function hide() : Void;
        @:require(flash10_2) static function registerCursor(name : String, cursor : flash.ui.MouseCursorData) : Void;
        static function show() : Void;
    }

  • thanks for this code snippet, implementing native cursors (haxe r3794)

    slould mention that flash9/ui/MouseCursorData.hx also should be changed as MouseCursorData() takes no params:
    so this line should be replaced

    function new(name : String) : Void;
    with
    function new() : Void;

< Prev | Page 1 / 1 | Next >