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

  • Home
  • SEARCH
  • 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 5844473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:17:49+00:00 2026-05-22T12:17:49+00:00

I am currently working with a drawing tool for a mapping API, and every

  • 0

I am currently working with a drawing tool for a mapping API, and every time I double-click the mouse a map service will perform a measurement and display the length of the line that I am drawing.

I want to mimic this double-click manually by dispatching a MouseEvent.DOUBLE_CLICK, but the map service is not listening to this default Flex event. I suspect that the API has created a custom MapMouseEvent or something like it that is being dispatched when a user double-clicks the mouse.

Is there a way to determine which event is being dispatched when I double-click the mouse?

  • 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-22T12:17:50+00:00Added an answer on May 22, 2026 at 12:17 pm

    The API isn’t necessarily dispatching its own event. Even if it is, it has to listen for MouseEvents first. One could detect double-clicks using MouseEvent.DOUBLE_CLICK, or by listening for successive MouseEvent.CLICK or MouseEvent.MOUSE_DOWN events. There’s no way (just within Flash) to detect a double click without listening for one or more of those events somewhere.

    It’s also possible that the Map Service IS listening for the DOUBLE_CLICK event, but you’re not dispatching the MouseEvent from the right object. For example, if the map service does this:

    mapRoot.mapChild.addEventListener(MouseEvent.DOUBLE_CLICK, performMeasurement);
    

    and you do this:

    mapRoot.dispatchEvent(new MouseEvent(MouseEvent.DOUBLE_CLICK));
    

    nothing is going to happen.

    There are other possibilities as well:
    When you actually perform a double-click with the mouse, you cause several events to be dispatched:
    MOUSE_DOWN, MOUSE_UP, CLICK, MOUSE_DOWN, MOUSE_UP, CLICK, DOUBLE_CLICK

    It’s possible that the map service listens for MOUSE_DOWN, and adds the DOUBLE_CLICK listener inside the MOUSE_DOWN handler, like this:

    mapRoot.addEventListener(MouseEvent.MOUSE_DOWN, _mouseDownHandler);
    
    private function _mouseDownHandler(event:MouseEvent):void
    {
        var targ:InteractiveObject = event.target as InteractiveObject;
        targ.addEventListener(MouseEvent.DOUBLE_CLICK, _doubleClickHandler);
    }
    
    private function _doubleClickHandler(event:MouseEvent):void
    {
        var targ:InteractiveObject = event.target as InteractiveObject;
        targ.removeEventListener(MouseEVent.DOUBLE_CLICK, doubleClickHandler);
        performMeasurement();
    }
    

    So you may actually need to dispatch a combination of events to trigger the handler.


    You can try the following:

    Use DisplayObjectContainer.getObjectsUnderPoint() to get an Array of all the objects that could be responding to the click. Then from each of the objects in that array, try dispatching various sequences of MouseEvents till you come up with the right event(s) from the right object.

    Take note though, that if
    areInaccessibleObjectsUnderPoint() returns true for the point you test at, then there are some objects you won’t be able to get access to, and if those are the ones the map service is listening to, then you’re out of luck.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im currently working on a project for my first course in Ruby. A part
I’m currently working on a reporting library as part of a large project. It
I am currently working with PHP code that random selects colors: <div onclick=location.href='<?php the_permalink()
I'm currently working on a program in C# WPF. I use an external dll
I'm currently working with on a fat client application using a self written RMI
I am currently working on my own little project, but I have a little
I am currently working on an in house GIS app. Background images are loaded
I'm currently working on a project that requires animation on a transparent panel. I
Currently working on something which uses ajax for some pagination. What I'm looking to
I'm currently working on a project in which i need to read some (Latitude,

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.