私は今、他のすべてのアプリが持っているように、タッチデバイスでスムーズなスクロールを取得する方法を理解しようとしています..当分の間、これを実装しました:
Multitouch.inputMode = MultitouchInputMode.GESTURE;
stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeHandler);
function fl_SwipeHandler(event:TransformGestureEvent):void
{
switch(event.offsetX)
{
// swiped right
case 1:
{
// Start your custom code
// This example code moves the selected object 20 pixels to the right.
// End your custom code
break;
}
// swiped left
case -1:
{
// Start your custom code
// This example code moves the selected object 20 pixels to the left.
// End your custom code
break;
}
}
switch(event.offsetY)
{
// swiped down
case 1:
{
// Start your custom code
// This example code moves the selected object 20 pixels down.
if (PActive == true) {
dgPlace.verticalScrollPosition = dgPlace.verticalScrollPosition - 60;
}
if (SActive == true) {
dgSubject.verticalScrollPosition = dgSubject.verticalScrollPosition - 60;
}
if (OActive == true) {
dgObject.verticalScrollPosition = dgObject.verticalScrollPosition - 60;
}
if (FActive == true) {
dgFeeling.verticalScrollPosition = dgFeeling.verticalScrollPosition - 60;
}
if (AActive == true) {
dgAction.verticalScrollPosition = dgAction.verticalScrollPosition - 60;
}
if (NActive == true) {
dg.verticalScrollPosition = dg.verticalScrollPosition - 60;
}
// End your custom code
break;
}
// swiped up
case -1:
{
// Start your custom code
// This example code moves the selected object 20 pixels up.
if (PActive == true) {
dgPlace.verticalScrollPosition = dgPlace.verticalScrollPosition + 60;
}
if (SActive == true) {
dgSubject.verticalScrollPosition = dgSubject.verticalScrollPosition + 60;
}
if (OActive == true) {
dgObject.verticalScrollPosition = dgObject.verticalScrollPosition + 60;
}
if (FActive == true) {
dgFeeling.verticalScrollPosition = dgFeeling.verticalScrollPosition + 60;
}
if (AActive == true) {
dgAction.verticalScrollPosition = dgAction.verticalScrollPosition + 60;
}
if (NActive == true) {
dg.verticalScrollPosition = dg.verticalScrollPosition + 60;
}
// End your custom code
break;
}
}
これは基本的に、スワイプが発生した場合、アクティブなデータグリッドを上下に 60 単位 (2 行) スクロールすることを示しています。誰かがこれを行う方法を知っている場合は、助けていただければ幸いです。^_^