private var beginY:Number;private function touchEventHandler(e:TouchEvent):void{ // TODO Auto Generated method stub var touch:Touch = e.getTouch(e.target as DisplayObject); if(touch) { if(touch.phase == TouchPhase.BEGAN)beginY = touch.globalY; else if(touch.phase == TouchPhase.ENDED) { if((touch.globalY - beginY) > 0) { trace("scroll down"); } else if((touch.globalY - beginY) < 0) { trace("scroll up"); } } }}
时间: 2024-11-06 11:59:49