[AS2 Flash8] Accedental Loop and not knowing how

Hello everyone.
I got this code for a really simple Duck Hunt game that worked fine till I tried to turn it into a function to allow more functionality (go figure). It originally ran on a _root.onEnterFrame() and now I’m running it as a function in the same location… Well in the long run it is supposed to let a duck go across the stage then when the right conditions are met, do it again. Right now it is moving one frames worth of movement and going back to its starting location.

Random Other Maybe Useful Info:

30 FPS
the duck’s instance name is “duck_1”
duck’s are 100x40 pixels
explosions are 250x250 and expand to 350x350.


//Simplified Version

//Vars
var duckHit_2:Boolean = false;
var duckOnScreen_2:Boolean = false;
var duckReadyToGo_2:Boolean = false;
var duckSpeed_2:Number = 0;
var duckExp_2:Number = 600;

_root.onEnterFrame = function()
{
    duckGo(duck_1, duckHit_1, duckOnScreen_1, duckReadyToGo_1, duckSpeed_1, duckExp_1, exp_1);
};


//       duckGo (duck_1, duckHit_1, duckOnScreen_1, duckReadyToGo_1, duckSpeed_1, duckExp_1, exp_1);
function duckGo(duck, duckHit, duckOnScreen, duckReadyToGo, duckSpeed, duckExp, exp)
{
    /* **************** Duck Hit Tests **************** */
    //This checks to see if the variable on the duck is not hit.
    if (duckHit == false)
    {
        //If not hit then define the function for when it is clicked.
        duck.onPress = function()
        {
            //If hit change hitDuck to true to show it is hit and switch to its duckDrop Frame.
            duckHit = true;
            duck.gotoAndStop('duckDrop');
        };
    }
    if (duckHit == true)
    {
        duck._x -= 15;
        duck._y += 25;
    }
    /* **************** Move Ducks **************** */ 
    if ((duckOnScreen == false) && (duckReadyToGo == false))
    {
        duck._x = 605;
        //duck._y = Math.floor (Math.random () * 225) + 50;
        //Random Number of 16-24. This is the pixels it moves per frame when it moves.
        duckSpeed = Math.floor(Math.random() * 17) + 8;
        duckReadyToGo = true;
    }
    if ((duckReadyToGo == true) && (duckHit == false))
    {
        duck._x -= duckSpeed;
        //This is the same as:
        //duck._x = duck._x - duckSpeed;
    }
    if ((duck._x <= -50) or (duck._y >= 650))
    {
        duck.gotoAndStop("duckSoar");
        duckReadyToGo = false;
        duckOnScreen = false;
        duckHit = false;
    }
    /* **************** Explosions **************** */ 
    if ((duck._y >= 400) && (duck._y <= 424))
    {
        exp._x = duck._x;
        exp.gotoAndPlay(2);
        exp._rotation = Math.floor(Math.random() * 360);
    }
}

I’d really appreciate some help, I need this done for class in a few days. I’m not sure if i explained this as well as I could… Sorry for any confusion ahead of time.