Skip to content

Instantly share code, notes, and snippets.

@drewbourne
Created March 4, 2011 03:27
Show Gist options
  • Save drewbourne/854118 to your computer and use it in GitHub Desktop.
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
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