I got a problem where the bullets won't get detected during the collision code.... The code to shoot the bullets works fine.. BUT it won't check collision... my guess for the problem would be the variable that declares bulletID.... but if i switch it to an array the collision works BUT.. it screws up the shooting aspect......
(below is the shooting code)

////////////shooting gun TEST
if (Key.isDown(65)&& _root.weapon =="gun" &&(_root.shooting == false) && _root.attack ==true) {
if (_root.player.direction_right == false) {
var bulletID:Number = Math.random();
//create a variable that we'll use at the bullet's id
//then attach a bullet to the stage
_root.attachMovie('mcBullet', 'Bullet'+bulletID, _root.getNextHighestDepth());
//setting the coordinates of the bullet to be the same as the main character
_root['Bullet'+bulletID]._x = player._x-90*(_root.player._yscale/100);
_root['Bullet'+bulletID]._y = player._y-172*(_root.player._yscale/100);
_root['Bullet'+bulletID].onEnterFrame = function() {
//giving the bullet some actions
this._x -= bulletspeed;
//moving the bullet
if (this._x<-1) {
//if the bullet goes off stage
//then destroy it
this.removeMovieClip();
}}
}
if (_root.player.direction_right == true) {
var bulletID:Number = Math.random();
//create a variable that we'll use at the bullet's id
//then attach a bullet to the stage
_root.attachMovie('mcBullet', 'Bullet'+bulletID, _root.getNextHighestDepth());
//setting the coordinates of the bullet to be the same as the main character
_root['Bullet'+bulletID]._x = player._x+90*(_root.player._yscale/100);
_root['Bullet'+bulletID]._y = player._y-172*(_root.player._yscale/100);
_root['Bullet'+bulletID].onEnterFrame = function() {
//giving the bullet some actions
this._x += bulletspeed;
//moving the bullet
if (this._x>900) {
//if the bullet goes off stage
//then destroy it
this.removeMovieClip();
}}
}
}

You are only checking for collision with a single bullet. You'll either need to give the bullets the collision function, and check it with an array of targets, or give the targets the collision function to check them with an array of bullets. I recommend the latter.

Firstly, don't use random numbers to determine bullet ID. It's quite easy to do it with an array if you know some simple array methods/functions.

the combination of arrays and functions seem to work... BUT.. at the moment when i shoot right and then i change the direction of my character to left... the bullet moves from moving right to moving left..... :(