私は、最新のSDKを使用してAir Mobileプロジェクトを開発する簡単なテストフラッシュを使用して、作業ズームジェスチャを作成しようとしています。これをsgsで起動すると、ズームジェスチャでは何も起こらず、画像だけがステージに追加されます。サンプルコードは次のとおりです。
package {
import flash.display.Bitmap;
import flash.display.MovieClip;
import flash.ui.Multitouch;
import flash.events.TransformGestureEvent;
import flash.ui.MultitouchInputMode;
public class Main extends MovieClip {
[Embed(source = "elevator.png")] public static const graph:Class;
public var elevator:Bitmap;
public function Main() {
elevator = new graph();
elevator.x = 0;
elevator.y = 0;
addChild(elevator);
init();
}
private function init():void
{
if(Multitouch.supportsGestureEvents)
{
setupGestures();
} else {
trace("it no worky");
}
}
private function setupGestures():void
{
Multitouch.inputMode = MultitouchInputMode.GESTURE;
elevator.addEventListener(TransformGestureEvent.GESTURE_ROTATE, handleGestures);
elevator.addEventListener(TransformGestureEvent.GESTURE_ZOOM, handleGestures);
}
private function handleGestures(event:TransformGestureEvent):void
{
if(event.type == "gestureRotate")
{
elevator.rotation += event.rotation;
} else {
elevator.scaleX *= event.scaleX;
elevator.scaleY *= event.scaleY;
}
}
}
}
どこを間違えますか?
更新しました。これがapplication.xmlです:
<?xml version="1.0" encoding="utf-8" ?>
<id>air.multitouch</id>
<versionNumber>0.1</versionNumber>
<supportedProfiles>mobileDevice</supportedProfiles>
<filename>multitouch</filename>
<name>multitouch</name>
<description></description>
<copyright></copyright>
<android>
<manifestAdditions><![CDATA[
<manifest android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen.multitouch"/>
</manifest>
]]></manifestAdditions>
</android>
<iPhone>
<InfoAdditions><![CDATA[
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UIRequiresPersistentWiFi</key>
<string>NO</string>
<key>UIPrerenderedIcon</key>
<true/>
<key>UIApplicationExitsOnSuspend</key>
<true/>
<key>UIDeviceFamily</key>
<array>
<!-- iPhone support -->
<string>1</string>
<!-- iPad support -->
<!--<string>2</string>-->
</array>
]]></InfoAdditions>
<requestedDisplayResolution>high</requestedDisplayResolution>
</iPhone>
<initialWindow>
<title>multitouch</title>
<content>multitouch.swf</content>
<visible>true</visible>
<fullScreen>true</fullScreen>
<autoOrients>false</autoOrients>
<aspectRatio>landscape</aspectRatio>
<renderMode>direct</renderMode>
</initialWindow>
<icon>
<image48x48>icons/icon_48.png</image48x48>
<image57x57>icons/icon_57.png</image57x57>
<image72x72>icons/icon_72.png</image72x72>
<image114x114>icons/icon_114.png</image114x114>
<image512x512>icons/icon_512.png</image512x512>
</icon>
<!--
AIR options:
http://livedocs.adobe.com/flex/3/html/File_formats_1.html#1043413
AIR mobile options:
http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-5d0f4f25128cc9cd0cb-7ffe.html
Android manifest documentation:
http://developer.android.com/guide/topics/manifest/manifest-intro.html
-->
上。これが例です.apkhttps ://dl.dropbox.com/u/78904724/multitouch.apk