What is the technique for the effect of a photo zooming in larger on the screen. If an image is imported as .png how do you make it appear to grow from small photo to large photo? Shape Tween is disabled.
you don't need to change the code below the dotted line:
to scale any display object from startZoom to endZoom in steps number of steps, you can call startScaleF(). for example:
startScaleF(mc1,1,4,100); // to scale mc1 from 100% to 400% in 100 steps
startScaleF(mc2,1,-4,100); // to scale mc2 from 100% to -400% in 100 steps
startScaleF(mc3,.1,-5.2,40); // to scale mc3 from 10% to -520% in 40 steps
----------------------------------
function startScaleF(dobj:DisplayObject,startZoom:Number,endZoom:Number,steps: uint):void{
var mc:MovieClip = new MovieClip();
mc.step = 1;
mc.dobj = dobj;
mc.startZoom = startZoom;
mc.endZoom = endZoom;
mc.steps = steps;
dobj.scaleX = dobj.scaleY = startZoom;
mc.addEventListener(Event.ENTER_FRAME,scaleF);
}
function scaleF(e:Event):void{
e.currentTarget.dobj.scaleX = e.currentTarget.dobj.scaleY += (e.currentTarget.endZoom-e.currentTarget.startZoom)/e.currentTarget.s teps;
if(e.currentTarget.step>=e.currentTarget.steps){
e.currentTarget.removeEventListener(Event.ENTER_FRAME,scaleF);
} else {
e.currentTarget.step++;
}
}
North America
Europe, Middle East and Africa
Asia Pacific