Hi guys im trying to get a game together in AS3 and i was hoping you could halp me out. im relativley new to as3 but know as2 very well. My problem was that was that i dont know what im doing worng here
private function click_handler(Mousedown:Event){
var bulnum:int = 1
var iBulletSpeed:Number = 40;
var iBullet:MovieClip = this.attachMovie("iBullet_mc","slug"+bulnum, _root.getNextHighestDepth());
iBullet._x = iGun._x;
iBullet._y = iGun._y;
var randomNum:int = random(4)-(4/2);
var iBulletAngle:Number = ((iGun._rotation+randomNum-90)*Math.PI/180);
iBullet.xSpeed = Math.cos(iBulletAngle)*iBulletSpeed;
iBullet.ySpeed = Math.sin(iBulletAngle)*iBulletSpeed;
bulnum +=1
}
Then i would have the rest of the bullet stuff in something else but i can handle that but when i debug this i get these errors
1061: Call to a possibly undefined method attachMovie through a reference with static type InfectedScripting.
1120: Access of undefined property _root.
1180: Call to a possibly undefined method random.
i know what these are i just dont know how to fix them thx.