Created
March 4, 2011 03:27
-
-
Save drewbourne/854118 to your computer and use it in GitHub Desktop.
None of MouseEvent.altKey, ctrlKey or shiftKey work on OS X with FP 10.2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Graphics; | |
import flash.display.Sprite; | |
import flash.display.StageAlign; | |
import flash.display.StageScaleMode; | |
import flash.events.MouseEvent; | |
[SWF(width="500", height="500", backgroundColor="#000000")] | |
public class MouseEventKeyboardModifiers extends Sprite | |
{ | |
public function MouseEventKeyboardModifiers() | |
{ | |
initialize(); | |
} | |
public function initialize():void | |
{ | |
stage.align = StageAlign.TOP_LEFT; | |
stage.scaleMode = StageScaleMode.NO_SCALE; | |
mouseEnabled = true; | |
mouseChildren = true | |
var c:Sprite = new Sprite(); | |
addChild(c); | |
var g:Graphics = c.graphics; | |
g.clear(); | |
g.beginFill(0xFF3333, 1.0); | |
g.drawRect(0, 0, 500, 500); | |
g.endFill(); | |
c.addEventListener(MouseEvent.CLICK, clicked); | |
} | |
public function clicked(event:MouseEvent):void | |
{ | |
trace('MouseEventKeyboardModifiers click altKey:', event.altKey, ' ctrlKey:', event.ctrlKey, ' shiftKey:', event.shiftKey); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment