Este es el codigo que tengo hasta ahora
AS:
Código ActionScript :
var sfx_gun:Sound = new sfx(); var sp:MovieClip = new ship(); var tm:Timer = new Timer(2000); tm.addEventListener(TimerEvent.TIMER, onstart); var bulletholder:Sprite = new Sprite(); addChild(bulletholder); addChild(sp); addEventListener(Event.ENTER_FRAME,onenter); stage.addEventListener(MouseEvent.CLICK,onclick); tm.start(); function onstart(e:Event){ var em:Sprite = new enemy(); em.x= Math.random()*550; addChild(em); } function onenter(e:Event):void { sp.x-=(sp.x-mouseX)*.1; sp.y-=(sp.y-350)*.2; } function onclick(e:Event) { sfx_gun.play(); sp.y=365; var bl:Sprite = new bullet(); bl.y=sp.y; bl.x=sp.x; bulletholder.addChild(bl); }
gracias por su ayuda.