Hello,
I'm hoping someone can help me out here.
I'm working on an AIR application for the iPad and I have a section that is using a very large infographic. 5000 x 3750
My stage is 1024 x 768 (iPad)
I have everything working.. however the animation is not smooth and seems to be jumping around on some touches.
I also am trying to implement pinch zooming .. but when I add the pinch zooming scripts it doesnt work. ..but if I remove all the code from ThrowProps and only have the pinch zooming code it works fine.
Any help with these 2 items is very much appreciated.
Here's my code..
// Test Code for Tech Chart
TweenPlugin.activate([ThrowPropsPlugin]);
var blitMask2:BlitMask = new BlitMask(techChart, 0, 0 , 1024, 768, true);
// This makes the blitMask interactive
blitMask2.bitmapMode = true;
var t1b:uint, t2b:uint, y1b:Number, y2b:Number, x1b:Number, x2b:Number;
blitMask2.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler2);
function mouseDownHandler2(event:MouseEvent):void {
trace("This is a test");
TweenLite.killTweensOf(techChart);
y1b = y2b = techChart.y;
x1b = x2b = techChart.x;
t1b = t2b = getTimer();
techChart.startDrag();
techChart.addEventListener(Event.ENTER_FRAME, enterFrameHandler2);
techChart.stage.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler2);
}
function enterFrameHandler2(event:Event):void {
y2b = y1b;
x2b = x1b;
t2b = t1b;
y1b = techChart.y;
t1b = getTimer();
blitMask2.update();
}
function mouseUpHandler2(event:MouseEvent):void {
techChart.stopDrag();
techChart.stage.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler2);
techChart.removeEventListener(Event.ENTER_FRAME, enterFrameHandler2);
var time:Number = (getTimer() - t2b) / 1000;
var yVelocity:Number = (techChart.y - y2b) / time;
var xVelocity:Number = (techChart.x - x2b) / time;
var yOverlap:Number = Math.max(0, techChart.height - techChart.height);
var xOverlap:Number = Math.max(0, techChart.width - techChart.width);
ThrowPropsPlugin.to(techChart, {throwProps:{
y:{velocity:yVelocity, max:-147, min:-2803, resistance:6000},
x:{velocity:xVelocity, max:-237, min:-3746, resistance:6000}
}, onUpdate:blitMask2.update, ease:Quad.easeOut
}, 10, 0.3, 0.5);
}
Multitouch.inputMode = MultitouchInputMode.GESTURE;
stage.addEventListener(TransformGestureEvent.GESTURE_ZOOM, fl_ZoomHandler);
function fl_ZoomHandler(event:TransformGestureEvent):void
{
techChart.scaleX *= event.scaleX;
techChart.scaleY *= event.scaleY;
}