0

I'm currently developing a flash game using Adobe Flash CS4 Professional and AS3. I have a custom cursor set up in my game, but it only changes position when the game renders a frame, 30 times per second, which could be better, so i want a custom native cursor.

Custom native cursor is a feature of Flash Player 10.2+, but in Flash CS4 i can only publish as Flash Player 10, and i can't have a custom native cursor.

So how do i add a custom native cursor to my game? Any workarounds/hacks appreciated.

I wont be buying a later version of Flash since this will probably by my last Flash game, as i will start to use Unity3D.

EDIT:

I used this tutorial from an answer below. I can now publish as Flash Player 10.2 or any other version i want. But i still can't get a custom native cursor working. I get the following error: VerifyError: Error #1014: Class flash.ui::MouseCursorData could not be found.

How can i make the flash.ui.MouseCursorData class work with Flash Pro CS4?

This is my code:

        var bitmapDatas:Vector.<BitmapData> = new Vector.<BitmapData>(1, true);
        var bitmapData:BitmapData = new CustomCursor(32,32);
        bitmapDatas[0] = bitmapData;

        var cursorData:MouseCursorData = new MouseCursorData();
        cursorData.hotSpot = new Point(0,0);
        cursorData.data = bitmapDatas;

        Mouse.registerCursor("MyCursor", cursorData);

        Mouse.cursor = "MyCursor";
CasperJ
  • 1
  • 2

1 Answers1

0

You need to add a new playerglobal.swc and a new Flash Player target configuration. Here's a tutorial that is specific to Flash CS5 and Flash Player 11, but should work for CS4 and any player you want.

Aaron Beall
  • 49,769
  • 26
  • 85
  • 103
  • I can now publish as Flash Player 10.2, but i get this error, when trying to import the package needed to add a custom native cursor: 1172: Definition flash.ui:MouseCursorData could not be found. – CasperJ Mar 30 '15 at 10:19
  • Nevermind, i can now import the MouseCursorData package, i forgot to change the as3 attribute text to "$(AppConfig)/ActionScript 3.0/FP10.2 in the flash player xml file. I will now try to get a custom native cursor working. – CasperJ Mar 30 '15 at 10:46