Noobie flash programmer here. I am trying to get the flash movie to play an imported punch sound after the user clicks a button. I got this error: "1046: Type was not found or was not a compile-time constant: punch."
here is the code:
stop();
var punch:punch = new punch();
btn2.addEventListener(MouseEvent.CLICK, playSound2);
function playSound2(e:MouseEvent):void
{
punch.play();
}
changing "var punch:punch = new punch();" to "var punchSound:punch = new punch();" solved my problem but I was wondering why "var punch:punch = new punch();" didn't work?
Thanks in advance