crosshair can shoot but sound effect doesn't work
hi all i'm new to adobe flash cs6. I want to create some shooting games here, but i've got some problem
i Have my action script like this :
import flash.events.Event;
import flash.events.MouseEvent;
addEventListener(Event.ENTER_FRAME,aaa);
function aaa(e:Event)
{
crosshair.x = mouseX;
crosshair.y = mouseY;
}
Mouse.hide();
movie1.addEventListener(MouseEvent.CLICK,bbb); /*movie1 is the enemy*/
function bbb(e:MouseEvent)
{
trace("Win");
}
crosshair.addEventListener(MouseEvent.CLICK,pistolShot);
function pistolShot(e:MouseEvent)
{
var s:PistolSound = new PistolSound();
s.play();
}
crosshair.mouseEnabled = false;
i want to my crosshair play the sound effect when it click.
When I remove this code:
crosshair.mouseEnabled = false;
crosshair can play the sound effect but I cannot shoot the enemy.
I can shoot the enemy with the code but it won't play the sound effect.
what code should I use?
thank you ![]()
