Hi Jamie Jefferson
Thanks for your help. I tried it though, and it hasn’t worked. Do you know if there is anything else I can try? Below is the code as I have it right now:
var allowPresses:Boolean = true;
function mouseDownHandler(event:MouseEvent):void{
allowPresses = false;
TweenLite.killTweensOf(container);
y1=y2=container.y;
t1=t2=getTimer();
container.startDrag(false, new Rectangle(bounds.x, -99999, 0, 99999999));
container.addEventListener(Event.ENTER_FRAME, enterFrameHandler);
container.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
}
function enterFrameHandler(event:Event):void{
y2=y1;
t2=t1;
y1=container.y;
t1=getTimer();
}
function mouseUpHandler(event:MouseEvent):void{
TweenLite.delayedCall(0.01, function() { allowPresses = true;
container.stopDrag();
container.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
container.removeEventListener(Event.ENTER_FRAME, enterFrameHandler);
var time:Number=(getTimer()-t2)/1000;
var yVelocity:Number=(container.y-y2)/time;
var yOverlap:Number=Math.max(0,container.height-bounds.height);
ThrowPropsPlugin.to(container,{ease:Strong.easeOut,throwProps:{y:{velocity:yVelocity,max:bounds.top,min:bounds.top-yOverlap,resistance:50}}},10,.25,1);
}
noticia.addEventListener(TouchEvent.TOUCH_TAP, onNoticia);
function onNoticia(event:TouchEvent):void{
if (allowPresses) {
// the code to do what he have to do
}
}
Regards,
Paulo