Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 716743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:20:02+00:00 2026-05-14T05:20:02+00:00

is it not possible to have both CLICK and DOUBLE_CLICK on the same display

  • 0

is it not possible to have both CLICK and DOUBLE_CLICK on the same display object? i’m trying to have both for the stage where double clicking the stage adds a new object and clicking once on the stage deselects a selected object.

it appears that DOUBLE_CLICK will execute both itself as well as the first CLICK functions in the path toward DOUBLE CLICK (mouse down, mouse up, click, mouse down, mouse up, double click).

in other languages i’ve programmed with there was a built-in timers that set the two apart. is this not available in AS3?


UPDATE

here’s some code. essentially what i would like is have one or the other, not both with double click

stage.doubleClickEnabled = true;
stage.addEventListener(MouseEvent.DOUBLE_CLICK, twoClicks, false, 0, true);
stage.addEventListener(MouseEvent.CLICK, oneClick, false, 0, true);

function oneClick(evt:MouseEvent):void
    {
    trace("One CLICK");
    }

function twoClicks(evt:MouseEvent):void
    {
    trace("Two CLICKS");
    }

//oneClick trace = "One CLICK"
//twoClicks trace = "One CLICK Two CLICKS" (instead of just Two CLICKS)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T05:20:02+00:00Added an answer on May 14, 2026 at 5:20 am

    Well, you could use setTimeout and clearTimeout.

    It’d look something like this:

    const var DOUBLE_CLICK_SPEED:int = 10;
    var mouseTimeout;
    
    function handleClick(evt:MouseEvent):void {
        if (mouseTimeout != undefined) {
            twoClicks();
            clearTimeout(mouseTimeout);
            mouseTimeout = undefined;
        } else {
            function handleSingleClick():void {
                oneClick();
                mouseTimeout = undefined;
            }
            mouseTimeout = setTimeout(handleSingleClick, DOUBLE_CLICK_SPEED);
        }
    }
    
    function oneClick(evt:MouseEvent):void {
        trace("One CLICK");
    }
    
    function twoClicks(evt:MouseEvent):void {
        trace("Two CLICKS");
    }
    stage.addEventListener(MouseEvent.CLICK, handleClick, false, 0, true);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is probably not possible, but I have this class: public class Metadata<DataType> where
Is it possible to have 2 git repositories in one directory? I'd think not,
Is it possible to have a <div> simultaneously (1) not take up all available
I'm not even sure if it's possible but say I have some XML: <source>
I'm not sure if this is even possible but here goes: Currently I have
It is not possible to check out a single file. The finest level of
It is not possible to fire an event in C# that has no handlers
As far as i know it is not possible to do the following in
The Java documentation says: it is not possible for two invocations of synchronized methods
In C++, it's not possible to initialize array members in the initialization list, thus

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.