Thumbnail mouse control AS2 to AS3 code conversion?

Hi there,
ive come across a problem… again haha, basically i want an action to take place when my mouse is within a certain amount of pixels of the edge of the screen (or boundaries). I know the AS2 code, but need it in AS3.
I realise that listeners are going to be needed, so if anyone is kind enough to help me out convert this code, i would really appreciate it :slight_smile:

heres the as2 code:

**root.onEnterFrame = function
if(_root._xmouse<50){
instanceName.prevFrame();
}
**