/ Published in: ActionScript 3
If you want to use the PlayBook's QNXApplication SWIPE_DOWN event in a SWF that will be used on other devices, check out this code.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; import flash.utils.getDefinitionByName; import qnx.system.QNXApplication; public class TestCC extends Sprite { public function TestCC() { super(); // support autoOrients stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; try { var c:Class = flash.utils.getDefinitionByName("qnx.system.QNXApplication") as Class; var q:QNXApplication; c.qnxApplication.addEventListener("swipeDown", swipeDown); } catch(error:Error) { graphics.beginFill(0xFF3333, 1); graphics.drawRect(50, 50, 200, 200); graphics.endFill(); } //QNXApplication.qnxApplication.addEventListener("swipeDown", swipeDown); } protected function swipeDown(event:Event):void { // TODO Auto-generated method stub graphics.beginFill(0x3333FF, 1); graphics.drawRect(50, 50, 200, 200); graphics.endFill(); } } }
URL: http://renaun.com