application active?

i have this problem that i dont know how to solve.
i use mouseOrbit script for rotation of the camera and it works fine but when i want to move the window whit unity content
i noticed that rotation still occurs and i am pressing the title bar … so i tried to prevent this in few ways

var winRect : Rect=new Rect(0,0,Screen.width,Screen.height);
if(winRect.Contains(invertedMousePosition)){
 
  //DO THE MOUSE ROTATION
 
}

that did not work so i tried this:

if(Application.isPlaying){
  //DO THE ROTATION
}

this did not work either, so i am out of ideas. could anyone help with this?

any ideas about this?

Is this in the web player?

yes, it is in the web player

I don’t know the answer (and I’m not sure if I fully understand the problem), but maybe the function OnApplicationFocus() might be of use.

i just learned that OnApplicationFocus is Unity3 i am still 2.6, can i handle it with 2.6
and to further explain the problem, so imagine that you have a mouseorbit script that rotates around selected object.
it normally works if you drag it in the unity window, but if you want to move the window itself (browser window) it still
catches the x and y values and updates rotation even when mouse is not in the unity window area… i hope this is clear enough

ok i managed to do it, before doing the rotation i check for (Screen.height-Input.mousePosition.y)<0, if it is then the mouse is off the unity area and mouse should not rotate, i dont know if that is the way to do it, but it works.

thanks!