this is my shooting game code, i dont know why bullet is not working propertly, and bullet can not shoot stone, clock is not work too.
could anyone here fix my problems plz?


//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
stop();


//----------------------------------Variables//
//////////////////////////////////////////////////////////////////////////
time = 180;
function clock() {
time--;
if (time == 0) {
clearInterval(timerId);
}
var timeId = setInterval(clock, 1000);
}
//////////////////////////////////////////////////////////////////////////
//Variables----------------------------------//
_root.score = 0;
var gameover:MovieClip;
var bulletspeed:Number = 12;
var bulletset:Boolean = true;
var allstone:Array =new Array(0);
var allExplosion:MovieClip = new MovieClip();
var mcCounter:Number=0;
var bulletArray:Array = new Array();
var bulletCount:Number = 0;
var explosionCount:Number = 0;
//attach two sounds
var aoe:Sound = new Sound();
//////////////////////////////////////////////////////////////////////////
function gameover(){



}
//Functions----------------------------------//
// create bullet and add new name call bullet plus bulletcount
function createbullets() {
var bulletmc = this.attachMovie("bullet", "bullet"+bulletcount, 1000+bulletcount);
// bullet pertision equal plane position
bulletmc._x = plane._x;
bulletmc._y = plane._y;
bulletArray[bulletcount] = _root["bullet"+bulletcount];
//add a bulletmc
bulletArray.push(bulletMc);
//plus 1
bulletcount++;
}
function movebullets() {
if (Key.isDown(32)) {
if (bulletset) {
createbullets();
bulletset = false;
}
}
if (!key.isDown(32)) {
bulletset = true;
}
}


//----------------------------------Functions//
function makeplane() {
// set plane's position
_root.attachMovie("plane", "plane", 1);
plane._x = 250;
plane._y = 250;
}
//move the plane up,down,left, right, withing the area,can not move out
function moveship(ap:MovieClip) {
if (Key.isDown(37) && ap._x>0) {
ap._x -= 20;
}
if (Key.isDown(39) && ap._x<460) {
ap._x += 20;
}
if (Key.isDown(38) && ap._y>0) {
ap._y -= 20;
}
if (Key.isDown(40) && ap._y<360) {
ap._y += 20;
}
}
//////////////////////////////////////////////////////////////////////////
function makestone(){
//attach movieclip stone and add new name
attachMovie("stone","s"+mcCounter,this.getNextHigh estDepth());
//stone randomly drow down
_root["s"+mcCounter]._x = Math.round(Math.random()*500);
_root["s"+mcCounter]._y = Math.round(Math.random()*400);

//Add names
//arry position i is now movieclip number i
allstone[mcCounter]=_root["s"+mcCounter];
// plus 1
mcCounter++;
}
// move the stone and set the position
function moveMe(target:MovieClip){

if(target._y<200){
target._y +=5;

}else{
removeMovieClip(target);
}

}
//////////////////////////////////////////////////////////////////////////
//gameover//////////////////////////////////////////////////////////////////
function gameover() {
gameover = attachMovie("gameover", "gg", 5);

}


//////////////////////////////////////////////////////////////////////////
//Events----------------------------------//
//Execute these actions once//
makeplane();

//Execute these actions always//
_root.onEnterFrame = function() {
moveship(plane);
movebullets();


//bullet always
for (i=0; i<bulletArray.length; i++) {
bulletArray[i]._y -= bulletspeed;


//
makestone();
for(i=0; i<allstone.length; i++){
moveMe(allstone[i]);
}

}

makeExplosion();
}
//----------------------------------Events//
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////