I'm having a problem setting the stage.mouseLock
property on AIR (3.2-3.4)
Compiling the following class in a FlashPlayer (11.2-11.4) Project works fine:
package
{
import flash.display.Sprite;
import flash.display.StageDisplayState;
import flash.events.KeyboardEvent;
public class Main extends Sprite
{
public function Main()
{
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);
}
private function onKeyDown(event:KeyboardEvent):void
{
stage.displayState = StageDisplayState.FULL_SCREEN;
stage.mouseLock = true;
}
}
}
But when I try to compile the same class targeting AIR instead of FlashPlayer, the following error occurs:
Error #1056: Cannot create property mouseLock on flash.display.Stage.
I'm using AIR SDK Version: 3.4.0.2710
and FlashDevelop 4.1.0 as my IDE.
EDIT: Even after a clean install of FlashDevelop, downloading Flex SDK, AIR SDK, FlashPlayerDebugger from scratch, the problem persists.
EDIT 2:
Thank you, TheDarkIn1978.
After adding the -swf-version=17
AND editing the application.xml
to use the correct version (3.4) manually, it worked...
I'll try to find out if it is a bug in the latest FlashDevelop or AIR SDK (probably is in the FD)...