Copy link to clipboard
Copied
Hola!! estoy haciendo una aplicación para dispositivos android pero quiero tengo un conocimiento básico de AS3 y quiero saber como hacer un touch scroll, no quiero poner un scroll bar o algun otro botón, quisiera que se pudiera navegar en la aplicación de modo touch y de manera horizontal.
Estoy trabajando con los tamaños por defecto 480x800 en un aplicación para android, en un proyecto de Adobe Flash Professional CC
Encontré este código en otro tema y funciona, el problema es que si llego al final de la lista que se muestra y sigo bajando no se detiene sigue como si hubiera mas contenido y no se no se regresa al contenido automáticamente y sigue bajando, y de igual manera en el principio del contenido si intento subir no se regresa solo al contenido y se sigue hacia arriba, ¿No se si me entiendan?
----------------------------------------------------
Hi! I am making an application for android devices, but I have a basic knowledge of AS3 and I want to know how to make a touch scroll not want to put a scroll bar or some other button, I would like you could navigate the application does so touch and vertically .
I'm working with the default size 480x800 on a android application, project in Adobe Flash Professional CC
I found this code on another theme and it works, the problem is that if I get to the bottom of the list that is displayed and continue down does not stop still as if it had more content and not return to the content automatically and continues to fall, and likewise at the beginning of the content if I try to back up not only the content and follow up, Do not know if I understand?
(Sorry for the translation, my English is bad).
Este es el código / Here's the code:
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;
}
use something like:
var minY:Number=
var maxY:Number=
Copy link to clipboard
Copied
you need to restrict the value of targY.
Copy link to clipboard
Copied
Thanks for responding.
but ... How I can do that? 😕
Copy link to clipboard
Copied
use something like:
var minY:Number=
var maxY:Number=
Copy link to clipboard
Copied
Thank you! Great method, it worked perfect!
![]()
Copy link to clipboard
Copied
you're welcome.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more