1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var mouse_dx:Number=_xmouse;
var mouse_dy:Number=_ymouse;
var mouseSpeed:Number=1;


function checkPosition(Void):Void {
	if(_xmouse<mouseSpeed || _xmouse>(Stage.width-mouseSpeed) || _ymouse<mouseSpeed  || _ymouse>(Stage.height-mouseSpeed)) {
		in_mc._visible=false;
		out_mc._visible=true;
		trace("out");
	} else {
		in_mc._visible=true;
		out_mc._visible=false;
		trace("in");
	}
}
checkPosition(Void);

var mouseListener:Object = new Object();																					
mouseListener.onMouseMove = function():Void {																				
	mouse_dx = Math.abs(mouse_dx-_xmouse);
	mouse_dy = Math.abs(mouse_dy-_ymouse);
	
	mouseSpeed = mouse_dx > mouse_dy ? mouse_dx  : mouse_dy;
	mouseSpeed +=1;
	
	checkPosition(Void);
	
	mouse_dx=_xmouse;
	mouse_dy=_ymouse;
}
Mouse.addListener(mouseListener);