有人知道AS3中的触摸滚动吗?
我们可以用手垂直/水平滚动,就像一个滑动手势 但我们滚动的对象是一个包含多个按钮的影片剪辑, 像这样http://codecanyon.net/item/air-as3-touch-scroll/3914642 和 http://bassta.bg/experiments/ActiveSwipe.zip
但我想了解如何制作影片剪辑(包含多个按钮)? 谁知道替代方式?请帮我 :( 抱歉我的英文不好
答案 0 :(得分:0)
您可以使用Swipe Gesture event
import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.events.TransformGestureEvent;
import flash.events.GestureEvent;
Multitouch.inputMode = MultitouchInputMode.GESTURE;
var mySprite:Sprite = new Sprite();
var myTextField:TextField = new TextField();
mySprite.graphics.beginFill(0x00c4ff);
mySprite.graphics.drawRect(0,0,40,40);
addChild(mySprite);
function swipehandler(evt:TransformGestureEvent): void {
myTextField.text = "I've been swiped";
myTextField.y = 50;
addChild(myTextField);
}
mySprite.addEventListener(TransformGestureEvent.GESTURE_SWIPE, swipehandler);