# How to make a cursor transparent upon leaving screen?

**URL:** <https://forum.kirupa.com/t/how-to-make-a-cursor-transparent-upon-leaving-screen/329032>\
**Category:** flash\
**Created:** [July 15, 2012, 6:19am UTC](https://forum.kirupa.com/t/how-to-make-a-cursor-transparent-upon-leaving-screen/329032 "2012-07-15T06:19:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomasP](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@thomasP](https://forum.kirupa.com/u/thomasP)\
**Post date:** [July 15, 2012, 6:19am UTC](https://forum.kirupa.com/t/how-to-make-a-cursor-transparent-upon-leaving-screen/329032/1 "2012-07-15T06:19:34Z")

</div>

Hi,

```
I found this code on a website that enables the cursor to become transparent upon leaving the screen. It works fine by itself, however when I try to use it with another code an error message shows it that it needs another bracket as well as an unnecessary bracket.   

```

```auto

function Start() {
	stage.addEventListener(Event.MOUSE_LEAVE,cursorHide);
	stage.addEventListener(MouseEvent.MOUSE_MOVE,cursorFollow);
}
function cursorHide(evt:Event):void {
	cursor.gotoAndPlay("104");
}
function cursorFollow(evt:MouseEvent):void {
	if (cursor.currentFrame != 0) {
		cursor.gotoAndStop(1);
	}
	cursor.x = stage.mouseX;
	cursor.y = stage.mouseY;
	evt.updateAfterEvent();
}

```

Is there any way to simplify this coding and to ensure that it works with other code?  
Any help would be greatly appreciated.

Tom
