Return to Snippet

Revision: 42608
at March 8, 2011 05:03 by renaun


Initial Code
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();
		}
	}
}

Initial URL
http://renaun.com

Initial Description
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.

Initial Title
Using QNXApplication with PlayBook and non-PlayBook devices

Initial Tags
actionscript

Initial Language
ActionScript 3