1

Anyone knows about touch scrolling in AS3 ?

We can scroll with our hand vertical / horizontal, like a swipe gesture but the object that we scroll is a movie clip that contains multiple button inside, like this http://codecanyon.net/item/air-as3-touch-scroll/3914642 and http://bassta.bg/experiments/ActiveSwipe.zip

but i onlu want to know how make movie clip (that contains multiple button ) can be scrolled? Anyone knows the alternative way ? Please help Me :( sorry for my bad english

1 Answers1

0

You can use the 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); 
Fergoso
  • 1,584
  • 3
  • 21
  • 44
  • Additionally to the event itself, you will have to define the scrollRect property of the MovieClip. Please refer to this: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#scrollRect – Jan Oct 06 '14 at 08:35