I am trying to disable the right click context menu on HTML5 (Using latest OpenFL 4), but the compiler throws an error when I am trying to use untyped (also reports the wrong line this is occurring at)
#if (js)
untyped {
document.oncontextmenu = document.body.oncontextmenu = function() {return false;}
}
#end
Also tried to use stage.showDefaultContextMenu = false;
or stage.addEventListener(MouseEvent.RIGHT_CLICK, function(e:Event){ e.preventDefault(); return false; });
but that seems it works only on flash and causes an error/or it does nothing anywhere else.
Do I need to install something else for untyped to work?