Mouse detection outside flash window

I have a moving banner with some pictures in it. If you move your mouse to the left the speed to the left increases, and if you move to the right the speed increases in the opposite way.

an example can be found here:

The problem is that if you leave the window flash remembers the last _xmouse position. I want that the speed is reset to a default value when you leave the Flash window.

I’ve tried to make this with a border of 5 px and a hittest to test if you are leaving the window, but with the fps set to 30 this is to slow if you leave the window to fast.

how could i solve this problem best?

source code:
frame1:


//namenlijst
_global.namesArray = Array(    "angela_hubel",
                "annelies_planteijdt",
                "beate_weiss",
                "cecile_van_eeden",
                "elly_vos",
                "laura_bakker",
                "monika_gloss",
                "sabine_ring-kirschler",
                "site_falkena",
                "stephen_greenstein"
                );

//inladen namen
arrayLength = namesArray.length - 1;
_global.pictures = namesArray.length
arrayLengthLast = namesArray.length - 10
i = 0;
j = 10;
xDistance = 0;
k = 0;

while(arrayLengthLast <= arrayLength)
{
    tmp = _root.theBar.createEmptyMovieClip(namesArray[arrayLengthLast]+"v", j);
    tmp.loadMovie(namesArray[arrayLengthLast]+".jpg");
    tmp._x = xDistance;
    arrayLengthLast++;
    j++;
    xDistance = xDistance + 90;
}

while(i <= arrayLength)
{
    tmp = _root.theBar.createEmptyMovieClip(namesArray*, j);
    tmp.loadMovie(namesArray*+".jpg");
    tmp._x = xDistance;
    i++;
    j++;
    xDistance = xDistance + 90;
}

while(k <= 9)
{
    tmp = _root.theBar.createEmptyMovieClip(namesArray[k]+"a", j);
    tmp.loadMovie(namesArray[k]+".jpg");
    tmp._x = xDistance;
    k++;
    j++;
    xDistance = xDistance + 90;
}

// theBar goed zetten
_root.theBar._x = -900;

source code:
frame2:


if(_xmouse > 5 && _xmouse < 895)
{
    if(_root._xmouse <= 449)
    {
        xAsV = _root._xmouse - 450;
        speedV = -1*(xAsV/40) + 1;
        _root.theBar._x = _root.theBar._x - speedV;
    }
    
    if(_root._xmouse >= 450)
    {
        xAsA = _root._xmouse - 450;
        speedA = (xAsA/40) + 1;
        _root.theBar._x = _root.theBar._x + speedA;
    }
}
else
{
    _root.theBar._x = _root.theBar._x + 1;
}
    
if(_root.theBar._x < -90*(pictures)-900 )
    {
        _root.theBar._x = -900;
    }
    
if(_root.theBar._x > 0 )
    {
        _root.theBar._x = -900;
    }


for(i = 0;i < pictures;i++)
    {
        tmp = _root.theBar[namesArray*];
    }
trace(_xmouse);

source code:
frame3:


gotoAndPlay(2);