// some _root level variables _root.hits = 0; _root.direction = 0; _root.running = false; // create a background var grad:Gradient = new Gradient(); grad.fill(_root,0,0,550,400); _root.createEmptyMovieClip("avatar", 3); with(_root.avatar){ onLoad = function(){ _root.avatar.yOffset = 100; x = -15; }; onEnterFrame = function(){ if(x > -15) { x -= .2; y=(x*x); _y = y + yOffset; } }; _x = 400; _y = 325; } var grid:Grid = new Grid(); _root.createEmptyMovieClip("projectile",2); _root.projectile._visible = false; _root.projectile.onEnterFrame = function(){ with(_root.projectile){ if(_x >-20 && _x < 550) _x += (direction*10); else _visible = false; for(var i=0;i