Copy link to clipboard
Copied
I have started developing a simple iphone app in flash CS5
In that app there is a bulk of text in ABOUT US section which need touch scrolling.right now i have added scroll bar.But i want to make the text touch scroll able..Since i will be using it in Iphone.

Help me out..
Copy link to clipboard
Copied
Place your text inside of a movieclip, and give it a instace of dragMe, then paste this code into your timeline (or edit it if your using a class).
var ease:int = 6; var targY:int = dragMe.y; var drag:Boolean = false; var ptY:Number = 0; dragMe.addEventListener(Event.ENTER_FRAME, dragHandler, false, 0, true); dragMe.addEventListener(MouseEvent.MOUSE_DOWN, downHandler, false, 0, true); stage.addEventListener(MouseEvent.MOUSE_UP, upHandler, false, 0, true); function dragHandler(e:Event):void { if (drag) { targY = mouseY + ptY; } e.target.y += (targY - e.currentTarget.y) / ease; } function upHandler(event:MouseEvent):void { drag = false; } function downHandler(e:MouseEvent):void { ptY = e.currentTarget.y - mouseY; drag = true; }
Find more inspiration, events, and resources on the new Adobe Community
Explore Now