HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.18k stars 655 forks source link

Issue 423 - Flash(10.2) native mouse cursor bug - haxe #423

Closed issuesbot closed 11 years ago

issuesbot commented 11 years ago

[Google Issue #423 : https://code.google.com/p/haxe/issues/detail?id=423] by hortobag...@gmail.com, at 24/05/2011, 10:06:26 What steps will reproduce the problem?

  1. flash9.ui.Mouse.hx and lash9.ui.MouseCursorData.hx lib is not correct, please compare with the Adobe doc.: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/Mouse.html

Please complete the following class with minimal code reproducing the problem :

class Test

{
    static function main()
    {
        var mouse_cursor_vector:Vector<flash.display.BitmapData> = new Vector<flash.display.BitmapData>();
        mouse_cursor_vector[0] = new Crsr_move(); // this is an external BitmapData class - use any, max 32x32 png or jpg image
        var mouse_cursor_data:MouseCursorData = new MouseCursorData(); // this function take no parameter, but in flash9/ui/MouseCursorData.hx it takes a string
        Mouse.registerCursor("new_crsr", mouse_cursor_data);
        // the Mouse.cursor can get 2 types, but in flash9/ui/Mouse.hx  it can be only 1
        Mouse.cursor = MouseCursor.AUTO; // it switch back the mouse cursor into the default behaviour, type: MouseCursor
        Mouse.cursor = "new_crsr"; // this line switch the mouse cursor into the defined BitmapData, type: String
        }
    }

Please provide any additional information below. Here is the corrected flash9/ui/Mouse.hx

package flash.ui;

extern class Mouse {
    @:require(flash10) static var cursor : Dynamic; // need String, and MouseCursor type - maybe @:multitype is the solution
    @: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;
    }

And the corrected flash9/ui/MouseCursorData.hx

package flash.ui;

@ :final @ :require(flash10_2) extern class MouseCursorData {
    var data : flash.Vector<flash.display.BitmapData>;
    var frameRate : Float;
    var hotSpot : flash.geom.Point;
    var name : String;
    function new() : Void;
    }

issuesbot commented 11 years ago

[comment from ncanna...@gmail.com, published at 14/07/2011, 21:33:17] This issue was closed by revision 19013a87c16eecd5f776019b74993e81c4519267.