I like to bounce on stage

Hi all,
I am pretty much a complete beginner with programming and new to this forum so please, excuse my simplicity.

After successfully embedding a *.gif image and resizing it (pretty spesh i know), I decided I wanted the image (a soccerball) to bounce around the screen diagonally, continuously, much like the way the old screensavers used to do.

for the ball movement i have used four seperate
addEventListener(Event.ENTER_FRAME, event#);
calls for each of the four possible diagonal movements I wanted for my ball; those being: downright, downleft, upright, upleft (for want of a better description)[FONT=Courier New]

[/FONT] and I used if statements to change the diagonal movement of the ball when it hits the edge/edges of the screen;

i.e.


             if (image.hitTestPoint(x#, y#, true)){
                removeEventListener(Event.ENTER_FRAME, currentevent#);
                addEventListener(Event.ENTER_FRAME, newevent#);
            }
            
            if (image.x == #){
                removeEventListener(Event.ENTER_FRAME, currentevent#);
                addEventListener(Event.ENTER_FRAME, newevent#);}
  
            if (gfx.y == #){
                removeEventListener(Event.ENTER_FRAME, currentevent#);
                addEventListener(Event.ENTER_FRAME, newevent#);
            }
        } 

and this works well for about 30 seconds and I can see the ball can bounce diagonally in each of the four directions, after which time the ball decides to move straight down, straight left, continue diagonally for a time, and then straight for a few seconds then come to rest on the left side of the screen near the bottom.

And it doesn’t necessarily happen when the ball hits directly in the corner of the screen, (I have tested it using various starting positions). I am thinking it is perhaps a memory/cache issue but I really have no idea why it is happening so would be interested in anyone’s ideas to improve this simple little program.

Thanx in advance
Damien A.