我有一个容器有很多带有滚动的图像,我添加TouchEvent.TOUCH
为事件侦听器而不是MouseEvent.CLICK
,因为八哥不支持MouseEvent
。问题是当我在TouchEvent
不需要的时候它会监听的图像之间导航时?有什么解决方案可以代替TouchEvenet
吗?
编码 :
private function onComplete (event:flash.events.Event):void
{
bitmapData = Bitmap(LoaderInfo(event.target).content).bitmapData;
var newImage:Image = Image.fromBitmap(Bitmap(LoaderInfo(event.target).content));
newImage.height = 154;
newImage.width = 180;
addChild(newImage);
newImage.addEventListener(starling.events.TouchEvent.TOUCH,image_clickHandler);
}
private function image_clickHandler(event:starling.events.TouchEvent):void
{
var touch:Touch = event.getTouch(stage);
if (touch != null)
{
if (touch.phase == TouchPhase.BEGAN)
{
//some code
}
}
}