论坛首页 编程语言技术论坛

Flex Mobile手势检测

浏览 3393 次
精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
作者 正文
   发表时间:2011-10-12  

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
		xmlns:s="library://ns.adobe.com/flex/spark"
		initialize="init()" title="测试支持的手势">
	<fx:Script>
		<![CDATA[
			import flash.ui.Multitouch;

			private function init():void
			{
				for each (var gesture:String in Multitouch.supportedGestures)
				{
					this[gesture + "Enabled"].selected=true;
					addEventListener(gesture, function(e:GestureEvent):void
					{
						e.currentTarget[e.type + "Tested"].selected=true;
					});
				}
			}
		]]>
	</fx:Script>
	<s:Scroller width="100%" height="100%">
		<s:VGroup gap="10" paddingBottom="15" paddingLeft="20" paddingRight="20" paddingTop="15">
			<s:HGroup gap="20" verticalAlign="middle">
				<s:Label width="110" fontSize="36" text="拖动"/>
				<s:Image width="137" source="@Embed('/gestures/pan.png')"/>
				<s:VGroup gap="10">
					<s:CheckBox id="gesturePanEnabled" content="有效" mouseEnabled="false"/>
					<s:CheckBox id="gesturePanTested" content="已测试" mouseEnabled="false"/>
				</s:VGroup>
			</s:HGroup>
			<s:HGroup gap="20" verticalAlign="middle">
				<s:Label width="110" fontSize="36" text="旋转"/>
				<s:Image width="137" source="@Embed('/gestures/rotate.png')"/>
				<s:VGroup gap="10">
					<s:CheckBox id="gestureRotateEnabled" content="有效" mouseEnabled="false"/>
					<s:CheckBox id="gestureRotateTested" content="已测试" mouseEnabled="false"/>
				</s:VGroup>
			</s:HGroup>
			<s:HGroup gap="20" verticalAlign="middle">
				<s:Label width="110" fontSize="36" text="缩放"/>
				<s:Image width="137" source="@Embed('/gestures/zoom.png')"/>
				<s:VGroup gap="10">
					<s:CheckBox id="gestureZoomEnabled" content="有效" mouseEnabled="false"/>
					<s:CheckBox id="gestureZoomTested" content="已测试" mouseEnabled="false"/>
				</s:VGroup>
			</s:HGroup>
			<s:HGroup gap="20" verticalAlign="middle">
				<s:Label width="110" fontSize="36" text="敲击"/>
				<s:Image width="137" source="@Embed('/gestures/swipe.png')"/>
				<s:VGroup gap="10">
					<s:CheckBox id="gestureSwipeEnabled" content="有效" mouseEnabled="false"/>
					<s:CheckBox id="gestureSwipeTested" content="已测试" mouseEnabled="false"/>
				</s:VGroup>
			</s:HGroup>
			<s:HGroup gap="20" verticalAlign="middle">
				<s:Label width="110" fontSize="36" text="两指触击"/>
				<s:Image width="137" source="@Embed('/gestures/twoFingerTap.png')"/>
				<s:VGroup gap="10">
					<s:CheckBox id="gestureTwoFingerTapEnabled" content="有效" mouseEnabled="false"/>
					<s:CheckBox id="gestureTwoFingerTapTested" content="已测试" mouseEnabled="false"/>
				</s:VGroup>
			</s:HGroup>
			<s:Label fontSize="12" text="手势图由 GestureWorks.com 提供"/>
		</s:VGroup>
	</s:Scroller>
</s:View>
 
论坛首页 编程语言技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics