A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Detecting middlemouse (no ASnative anymore?)

  1. #1
    Junior Member
    Join Date
    Jul 2008
    Posts
    3

    Detecting middlemouse (no ASnative anymore?)

    It was always easily possible to detect middle and right mouse button clicks with the ASnative call, but this doesn't seem to exist in AS3.0 anymore. I'm guessing that was because it wasn't recommended since it was never documented.

    Is it even possible to detect middle/right clicks in AS3.0 without the use of javascript?

    If not, is it possible to import the javascript into the .swf file so it's all together?

    AS3.0 livedocs lists functions such as rightMouseDown() but they're "Only available in the AIR runtime". I don't know what that means.

    I can't understand why flash seems so set against users making middle mouse clicks, I can understand they want to keep the menu with the right click.

    Thankyou for any help or information you can give concerning my questions.

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    I don't see anything in MouseEvent which indicates the button for non-AIR contexts, but there is a delta property for detecting mousewheel movement.

    You can embed javascript into the swf file as a string and inject it into the hosting page through ExternalInterface. You cold define and call functions entirely from the swf, or do a document.write with a script tag to include an arbitrary .js file.

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Posts
    3
    As a string... ah excellent I didn't think of that, thankyou very much for your help.

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