Hi All,

I tried the example for custom mouse pointer as shown in Flash cs3
documentation. It works fine. But when the pointer graphics is added from
library, it works in a weird way. Mouse gets over the pointer graphics
resulting in flickering and choppy animation.

I have posted the source files here:
http://www.actionscript.org/forums/showthread.php3?t=139310


Here is the code i am using:

// pseudoMouse is the class of an mc in Library
//pad is the instance name of an mc on stage
//When mouseover mc, the cursor shows up
package{
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.ui.Mouse;

public class MouseManage extends MovieClip{
 private var cursor:pseudoMouse;

 public function MouseManage():void{
 cursor=new pseudoMouse();
 addChild(cursor);
 pad.addEventListener(MouseEvent.MOUSE_OVER,mOver);
 pad.addEventListener(MouseEvent.MOUSE_OUT,mOut);
}

private function mOut(event:MouseEvent):void{
 Mouse.show();
 pad.removeEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
 cursor.visible = false;
}

private function mOver(event:MouseEvent):void{
 Mouse.hide();
 cursor.visible =true;
 pad.addEventListener(MouseEvent.MOUSE_MOVE, redrawCursor);
}

private function redrawCursor(event:MouseEvent):void{
  cursor.x = event.stageX;
  cursor.y = event.stageY;
  event.updateAfterEvent();
 }
}
}



Any help would be highly appreciated.
Thanks.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to