I am creating a Frogger game in Flash AS3 and just wanted to see if anyone can help me improve it without breaking the game.The reason I ask for it because I don't have any errors, but I do get over 50 of these:Warning: 3596: Duplicate variable definition.package {    import flash.display.*;    import flash.events.*;    import flash.ui.*;    public class Frogger extends MovieClip    {        private var life, timeElapsed, totalTimer:Number;            private var p1speedX, p1speedY:Number;        private var gotoWin, gotoLose, standingOnLog:Boolean;        private var logs, Trucks, homes, logsYPos, TrucksYPos:Array;        public function startMenu()        {            btnStartGame.addEventListener(MouseEvent.CLICK, gotoStartGame);            stop();        }        public function startWin()        {            btnBack.addEventListener(MouseEvent.CLICK, gotoMenu);        }        public function startLose()        {            btnBack.addEventListener(MouseEvent.CLICK, gotoMenu);        }        public function startGame()        {                        timeElapsed = 0;            totalTimer = 60;            life = 3;            p1speedX = 0;            p1speedY = 0;            gotoWin = false;            gotoLose = false;            standingOnLog = false;            Trucks = new Array();            logs = new Array();            homes = new Array();            logsYPos = new Array(115,165,215,265);            TrucksYPos = new Array(365,415,465,515);            setupGame();            addEventListener(Event.ENTER_FRAME,update);            stage.addEventListener(KeyboardEvent.KEY_DOWN,keyDownHandler);            stage.addEventListener(KeyboardEvent.KEY_UP,keyUpHandler);            stage.focus = this;            for (var i=1; i<=3; i++)            {                    var newTruck = new Truck();                newTruck.x = -300 * i;                newTruck.y = TrucksYPos[0];                newTruck.speedX = 5;                Trucks.push(newTruck);                addChild(newTruck);            }            for (var i=1; i<=1; i++)            {                var newTruck = new Truck();                newTruck.x = (170 * i) + 500;                newTruck.y = TrucksYPos[1];                newTruck.speedX = -25;                Trucks.push(newTruck);                addChild(newTruck);            }            for (var i=1; i<=4; i++)            {                var newTruck = new Truck();                newTruck.x = (-220 * i) + 100;                newTruck.y = TrucksYPos[2];                newTruck.speedX = 8;                Trucks.push(newTruck);                addChild(newTruck);            }            for (var i=1; i<=2; i++)            {                var newTruck = new Truck();                newTruck.x = (200 * i) + 350;                newTruck.y = TrucksYPos[3];                newTruck.speedX = -5;                Trucks.push(newTruck);                addChild(newTruck);            }            for (var i=1; i<=4; i++)            {                var newLog = new LogWood();                newLog.x = -300 * i;                newLog.y = logsYPos[0];                newLog.speedX = 5;                logs.push(newLog);                addChild(newLog);                swapChildren(mcP1,newLog);            }            for (var i=1; i<=2; i++)            {                var newLog = new LogWood();                newLog.x = (170 * i) + 500;                newLog.y = logsYPos[1];                newLog.speedX = -5;                logs.push(newLog);                addChild(newLog);                swapChildren(mcP1,newLog);            }            for (var i=1; i<=2; i++)            {                var newLog = new LogWood();                newLog.x = (-220 * i) + 100;                newLog.y = logsYPos[2];                newLog.speedX = 14;                logs.push(newLog);                addChild(newLog);                swapChildren(mcP1,newLog);            }            for (var i=1; i<=3; i++)            {                var newLog = new LogWood();                newLog.x = (250 * i) + 400;                newLog.y = logsYPos[3];                newLog.speedX = -5;                logs.push(newLog);                addChild(newLog);                swapChildren(mcP1,newLog);            }        }        private function setupGame()        {            for (var i=0; i< MovieClip(root).numChildren; i++)            {                var object = MovieClip(root).getChildAt(i);                if (object is Home)                {                    homes.push(object);                }}}        private function gotoStartGame(evt:MouseEvent)        {            btnStartGame.removeEventListener(MouseEvent.CLICK, gotoStartGame);            gotoAndStop(game);        }        private function gotoMenu(evt:MouseEvent)        {            btnBack.removeEventListener(MouseEvent.CLICK, gotoMenu);            gotoAndStop(menu);        }        private function keyDownHandler(evt:KeyboardEvent)        {            if (evt.keyCode == Keyboard.LEFT)             {                p1speedX = -1;            }            else if (evt.keyCode == Keyboard.RIGHT)            {                p1speedX = 1;            }            if (evt.keyCode == Keyboard.UP)             {                p1speedY = -1;            }            else if (evt.keyCode == Keyboard.DOWN)            {                p1speedY = 1;            }        }        private function keyUpHandler(evt:KeyboardEvent)        {            if ((evt.keyCode == Keyboard.LEFT) || (evt.keyCode == Keyboard.RIGHT))            {                p1speedX = 0;            }            if ((evt.keyCode == Keyboard.UP) || (evt.keyCode == Keyboard.DOWN))            {                p1speedY = 0;            }        }        public function update(evt:Event)        {            handleUserInput();            handleGameLogic();            handleDraw();            if (gotoWin)                triggerGoToWin();            else if (gotoLose)                triggerGoToLose();        }        private function handleUserInput()        {            if (p1speedX > 0)            {                if (mcP1.x + 50 < 800)                    mcP1.x += 50;                p1speedX = 0;                mcP1.rotation = 90;                mcP1.play();            }            else if (p1speedX < 0)            {                if (mcP1.x - 50 > 0)                    mcP1.x -= 50;                    p1speedX = 0;                mcP1.rotation = -90;                mcP1.play();            }            if (p1speedY < 0)            {                mcP1.y -= 50;                p1speedY = 0;                mcP1.rotation = 0;                mcP1.play();            }            else if (p1speedY > 0)            {                if (mcP1.y + 50 < 600)                    mcP1.y += 50;                    p1speedY = 0;                mcP1.rotation = -180;                mcP1.play();            }        }        private function handleGameLogic()        {            timeElapsed++;            for (var i=Trucks.length-1; i>= 0; i--)            {                Trucks[i].x += Trucks[i].speedX;                if (Trucks[i].hitTestPoint(mcP1.x,mcP1.y))                {                    life--;                    resetGame();                }                if (Trucks[i].speedX < 0 && Trucks[i].x <= -50)                {                    Trucks[i].x = 850;                }                else if (Trucks[i].speedX > 0 && Trucks[i].x >= 850)                {                    Trucks[i].x = -50;                }            }            var standingOnLog = false;            for (var i=logs.length-1; i>= 0; i--)            {                logs[i].x += logs[i].speedX;                if (logs[i].hitTestPoint(mcP1.x,mcP1.y))                {                    standingOnLog = true;                    mcP1.x += logs[i].speedX;                }                if (logs[i].speedX < 0 && logs[i].x <= -50)                {                    logs[i].x = 850;                }                else if (logs[i].speedX > 0 && logs[i].x >= 850)                {                    logs[i].x = -50;                }            }            for (var i in homes)            {                if (homes[i].hitTestObject(mcP1))                {                    homes[i].gotoAndStop(occupied);                    mcP1.x = 400;                    mcP1.y = 565;                }            }            if (mcP1.y < 290)            {                if (!standingOnLog)                {                    life--;                    resetGame();                }            }            if ((totalTimer - Math.floor(timeElapsed/30) <= 0) ||                (life <= 0))                gotoLose = true;            var allOccupied = true;            for (var i in homes)            {                if (homes[i].currentLabel == empty)                    allOccupied = false;            }            if (allOccupied)                gotoWin = true;        }        private function handleDraw()        {            txtTime.text = String(totalTimer - Math.floor(timeElapsed/30));            txtLife.text = String(life);        }        private function clearGame()        {            for (var i=Trucks.length-1; i>= 0; i--)            {                removeChild(Trucks[i]);                Trucks.splice(i,1);            }            for (var i=logs.length-1; i>= 0; i--)            {                removeChild(logs[i]);                logs.splice(i,1);            }        }        private function triggerGoToWin()        {            clearGame();            removeEventListener(Event.ENTER_FRAME, update);            gotoAndStop(win);        }        private function triggerGoToLose()        {            clearGame();            removeEventListener(Event.ENTER_FRAME, update);            gotoAndStop(lose);        }        private function resetGame()        {            mcP1.x = 400;            mcP1.y = 565;        }    }}
Frogger game in Actionscript 3
game;actionscript 3;actionscript