torzep / custom-context-menu

Automatically exported from code.google.com/p/custom-context-menu
Other
0 stars 0 forks source link

Does not work unitl now #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I've posted this code bellow on my App, changed the warpper but doesn't
work. I have Win Vista Firefox 3.0.5 and IE7.

Here's the code.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application creationComplete="init()"
xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Script>
        <![CDATA[
            import mx.events.MenuEvent;
            import mx.controls.Alert;
            import flash.external.ExternalInterface;

            private function init():void {

            var methodName:String = "rightClick";
            var method:Function = onRightClick;
            ExternalInterface.addCallback(methodName, method);

            } 
            private function onRightClick(event:MouseEvent):void {
               if(event.buttonDown == true){
                  Alert.show("Left");
                  }
                else{
                  Alert.show("Right");
                }
        }

        ]]>
    </mx:Script>

    <mx:Canvas width="300" backgroundColor="#ffffff"
mouseDown="onRightClick(event)" height="247" x="177" y="93"/>
</mx:Application> 

What is the expected output? What do you see instead?

To work. But doesn't at all.

What version of the product are you using? On what operating system?
Firefox 3.0.5
IE 7.0+
Win Vista SP1.

Please provide any additional information below.

Original issue reported on code.google.com by igorco...@gmail.com on 3 Feb 2009 at 11:18

GoogleCodeExporter commented 8 years ago
hi, it seems that your "onRightClick" method was wrong implemented, try 
something
like this: 
private function onRightClick(event:MouseEvent=null):void{
if(event != null && event.buttonDown == true){
...
}
else if(event == null)
{
...
}
}

Goodbye from Russia,
gumengangler.

Original comment by gumengangler on 30 May 2009 at 12:31