码迷,mamicode.com
首页 > 其他好文 > 详细

starling TouchEvent

时间:2015-05-29 17:26:30      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:

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");
}
}
}
}

starling TouchEvent

标签:

原文地址:http://www.cnblogs.com/tonyning/p/4538631.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!