Recently Ive been learning AS3 (noob) and Ive been trying to customize a tutorial I found online. The functionality im trying to get:
A gallery type movie clip that has images in a grid format, when you click one of the thumbnails it zooms in and when you click it again it zooms back out to its original place setting. I have that part working fine. However, I would also like to have the thumbnail flip as its zooming in (basically showing its back) and when you click it again it flips back to the front as it zooms out.
Im getting this error when I publish the .fla to preview:
TypeError: Error #1006: Flip is not a function.
at PhotoPanelsFINISHED/scaleUp()
at PhotoPanelsFINISHED/onClick()
Here is the code im using:
package
{
import com.chuck.effects.EasyFlip;
import com.greensock.*;
import com.greensock.easing.*;
import flash.display.*;
import flash.events.*;
public class PhotoPanelsFINISHED extends MovieClip
{
public var inFocus:MovieClip;
public function PhotoPanelsFINISHED():void
{
setupClips();
}
public function setupClips():void
{
var len:int = con.numChildren;
for(var i:int=0; i<len; i++)
{
var mc:MovieClip = MovieClip(con.getChildAt(i));
mc.buttonMode = true;
mc.loc = [mc.x, mc.y];
mc.addEventListener(MouseEvent.CLICK, onClick);
}
}
public function onClick(e:MouseEvent):void
{
var mc:MovieClip = MovieClip(e.currentTarget);
if(inFocus == null)
{
scaleUp(mc);
}
else if(inFocus == mc)
{
TweenLite.to(inFocus, 0.5, {
scaleX:1,
scaleY:1,
x:inFocus.loc[0],
y:inFocus.loc[1],
ease:Expo.easeInOut,
onComplete:function(){inFocus=null;}
});
}
else
{
TweenLite.to(inFocus, 0.5, {
scaleX:1,
scaleY:1,
x:inFocus.loc[0],
y:inFocus.loc[1],
ease:Expo.easeInOut,
onComplete:scaleUp,
onCompleteParams:[mc]
});
}
}
public function scaleUp(mc:MovieClip):void
{
inFocus = mc;
con.addChild(mc);
mc.enlarge.alpha = 0;
mc.Flip("left",1.2,"Strong.easeOut");
TweenLite.to(mc, 0.5, {
scaleX:3,
scaleY:3,
x:0,
y:0,
ease:Expo.easeInOut
});
}
}
}
Any help would be greatly appreciated!!!