2014-10-06 83 views
1

任何人都知道在AS3中觸摸滾動?如何製作可滾動(帶觸摸)影片剪輯包含按鈕 - AS3?

我們可以用我們的手垂直/水平滾動,像一個滑動手勢 但對象是我們滾動的是,內部包含多個按鈕,影片剪輯, 這樣http://codecanyon.net/item/air-as3-touch-scroll/3914642http://bassta.bg/experiments/ActiveSwipe.zip

但我onlu想知道如何讓電影剪輯(包含多個按鈕)可以滾動? 任何人都知道替代方法?請幫我:( 對不起我的英文不好

回答

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); 
+0

此外,對於事件本身,你必須定義了MovieClip的scrollRect屬性請參閱本:HTTP ://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#scrollRect – Jan 2014-10-06 08:35:55