Cross can draw but the sound effect does not work

Hi all I am new to adobe flash cs6.  I want to create here a few shooting games, but I have a problem

I have my script of action 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);          / * Film1 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 room in the shape of a cross, the sound effect when he clicks.

When I delete this code:

crosshair.mouseEnabled = false;

in cross can play the sound effect, but I can't shoot the enemy.

I can shoot at the enemy with the code, but it will not play the sound effect.

should what code I use?

Thank you

use:

import flash.events.Event;

import flash.events.MouseEvent;

var s:PistolSound = new PistolSound();

crosshair.mouseEnabled = false;

this.addEventListener (Event.ENTER_FRAME, aaa);

this.addEventListener (MouseEvent.CLICK, clickF);

function clickF(e:MouseEvent):void {}

s.Play ();

}

function aaa(e:Event)

{

Crosshair.x = mouseX;

Crosshair.y = mouseY;

}

Mouse.Hide ();

Movie1.addEventListener (MouseEvent.Click, BBB);          / * Film1 is the enemy * /

function bbb(e:MouseEvent)

{

trace ("Win");

}

Tags: Adobe Animate

Similar Questions

Maybe you are looking for