A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: CS4/AS3: What is the difference between MouseEvent.MOUSE_UP and MouseEvent.CLICK???

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    133

    Question CS4/AS3: What is the difference between MouseEvent.MOUSE_UP and MouseEvent.CLICK???

    What is the difference between MouseEvent.MOUSE_UP and MouseEvent.CLICK?

    Why should I use one of these over the other?

    Code:
    myButton_btn.addEventListener(MouseEvent.MOUSE_UP, fNavigate, false, 0, true);
    
    myButton_btn.addEventListener(MouseEvent.CLICK, fNavigate, false, 0, true);

  2. #2
    Member
    Join Date
    Mar 2009
    Location
    Brooklyn, NY
    Posts
    77
    MOUSE_UP is fired only when the mouse button is released. MOUSE_CLICK needs to have both the mouse being pressed and mouse being released to be fired.

    There are cases when you need to be able to distinguish between the two. I recently made a site where the user could click and drag photos all around the stage (Using MOUSE_DOWN to startDrag, and MOUSE_UP to stop), but if they were clicked then a menu would open for that photo.
    Last edited by cessnajumpin; 04-09-2009 at 08:02 AM.
    Break it until it works.

  3. #3
    Senior Member vinayak.kadam's Avatar
    Join Date
    Oct 2006
    Location
    gotoAndPlay("Pune");
    Posts
    831
    Explanation is 100% perfect.
    As ever,
    Vinayak Kadam

Tags for this Thread

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