Flash AS3 undefined property MouseEvent in document class

Posted by Lee on Stack Overflow See other posts from Stack Overflow or by Lee
Published on 2010-03-13T19:56:37Z Indexed on 2010/03/13 20:35 UTC
Read the original article Hit count: 460

Filed under:
|
|
|
|

Hi guys, this is my first time trying to use document classes in AS3 and im struggling. I am trying to add event listeners to a 2 levels deep movie clip, waiting for a click however i am getting the following error.

ERROR: Access of undefined property MouseEvent 

package 
{
 import flash.display.MovieClip;
 import flash.media.Sound;
         import flash.media.SoundChannel;

 public class game extends MovieClip
 {
  public var snd_state = true;

  public function game()
  {
   ui_setup();
  }

  public function ui_setup()
  {
   ui_mc.toggleMute_mc.addEventListener(MouseEvent.CLICK, snd_toggle);
  }

  public function snd_toggle(MouseEvent)
  {
   // 0 = No Sound, 1 = Full Sound
   trace("Toggle");
  }
 }
}

© Stack Overflow or respective owner

Related posts about flash

Related posts about as3