Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
BernalCarlos

Remove TransformManager Custom Cursor

Recommended Posts

Hi,

 

I have a Sprite with a button in the center. The sprite can be transformed, but when the mouse is over the button the cursor stays in its default TransformManager move cursor.

 

So, to keep the default "button" cursor  (the one with the hand and the finger) when the mouse is over the button., i did the following:

 


_uploadPhotoHereMessageMc.addPhoto_btn.addEventListener(MouseEvent.MOUSE_OVER, showButtonCursor, false, 0, true);

private function showButtonCursor(evt: Event): void
{
  if(_transManager.isShowingCustomCursor) TransformManager.customizeMoveCursor(new Shape(), false, 0, 0);
}

 

However, i'm getting a null pointer exception from the TransforManager:

 

StackTrace: TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.
	at com.greensock.transform::TransformManager/snapCursor()[D:\datos\CarlosB\Documentos\Dropbox\PlasticoLab\Pixote2\PhotobookMaker\com\greensock\transform\TransformManager.as:2275]

 

"No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo"  -> means null pointer in Spanish.

 

Is there a better way to do this?

 

Link to post
Share on other sites

Yeah, those aren't designed to be swapped in/out while in use like that - they're meant as configuration tools. Have you tried just hiding the cursor and setting Mouse.show()? Kinda like:

 

yourTransformManager.moveCursor.visible = false;
Mouse.show();

And then of course toggle those back when necessary. 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×