Our Flash code affects InteractiveObject.contextMenu, but the object there when compiled for Air doesn't offer the same functionality.
Now, it strikes me as very peculiar that Air is not simply a superset & looser-security version of Flash, but actually breaks existing Flash code. Is there any way around this, where some compile-time decision can choose which calls to make on the contextMenu property, something like C's #ifdef?
Can you share a code snippet illustrating the problem?
Sure thing. This document class compiles & runs fine in Flash, but trying to run it in Air complains that hideBuiltInItems is unknown and doesn't work. Try adding a Component to the stage, and watch the error flicker.
public class Test extends Sprite
public function Test()
contextMenu = new ContextMenu();
This seems like a bug in the compiler.
For a workaround, you can create a temporary ContextMenu object, set the desired props and assign that to the contextMenu property:
var aMenu:ContextMenu = new ContextMenu();
contextMenu = aMenu;