A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Simple Button not working in CS4

  1. #1
    Member
    Join Date
    Nov 2008
    Posts
    49

    Simple Button not working in CS4

    Hello Mates,


    I have got a simple button in the first frame of my flash file, but its not wokring. Here is the code I am trying.

    Code:
    Btn.addEventListener (MouseEvent.CLICK, myFunction);
    function myFunction (e:MouseEvent):void {
    trace("working");
    }
    
    It gives this error: "The class or interface 'MouseEvent' could not be loaded"
    Please guide me if I am missing something.


    Many Thanks

  2. #2
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Are you importing the event?


    Try this:

    import flash.events.*;

    or

    import flash.event.MouseEvent;

  3. #3
    Member
    Join Date
    Nov 2008
    Posts
    49
    Yes mate, I have tried the both but still it gives the same error. I cant find any clue of why is it happening.

  4. #4
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Hmmm...Could you post your source code for review? I may be of further assistance with that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center