A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: right click WIHTOUTH context menu

  1. #1
    Senior Member
    Join Date
    Oct 2009
    Posts
    112

    right click WIHTOUTH context menu

    if this is the code:
    i
    Code:
    mport flash.display.*;
    import flash.external.ExternalInterface;
    
      
    function RightClick()
        {
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
              
            var methodName:String = "rightClick";
            var method:Function = onRightClick;
            ExternalInterface.addCallback(methodName, method);
        }
          
    function onRightClick():void {
            var mx:int = stage.mouseX;
            var my:int = stage.mouseY;
           if(my> 0 && my <stage.stageHeight && mx> 0 && mx <stage.stageWidth) {
                trace("mastButton"+" was rightCLICKED");
        }
    }
    then where do i tell it that i want to have the MouseEvent EventListener on my movieclip labeled "mastButton" ??
    (obviously i know its not really a MouseEvent but do u know what i mean? like how to i link this right click event TO a particular movieclip??)

  2. #2
    AS2 intolerant person
    Join Date
    Jan 2009
    Location
    Swansea
    Posts
    352
    it has nothing to do with actionscript:

    http://www.flashkit.com/tutorials/Ge...-859/index.php

  3. #3
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    The way that method works is by catching the r-click with javascript so it never reaches the flash player - then passing the coordinates in and triggering an "event handler" manually. It doesn't work in all browsers so you need to disable the menu as flosculus suggested.
    Please use [php] or [code] tags, and mark your threads resolved 8)

  4. #4
    Senior Member
    Join Date
    Oct 2009
    Posts
    112
    oh i see...well is there a simpler way to do this?

    im surprised AS3 has "DOUBLE_CLiCK" "MOUSE_DOWN" "MOUSE_UP" etc
    but no "RIGHT_CLICK"!!!

    thats all i need is a simple addEventListener(MosueEvent.RIGHT_CLICK.......but it doenst exist

  5. #5
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441
    Right click is reserved by Adobe for their context-menu...it's the only consistent path to get to the security settings panel so allowing it to be overridden opens up some possibilities to abuse the user.
    Please use [php] or [code] tags, and mark your threads resolved 8)

  6. #6
    Senior Member
    Join Date
    Oct 2009
    Posts
    112
    oh ok, ill probly use ctrl click instead

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