next_btn.addEventListener(MouseEvent.CLICK, clickNext);
prev_btn.addEventListener(MouseEvent.CLICK, clickPrev);
var shrinkCard:Tween;
var expandCard:Tween;
var shrinkCardB:Tween;
var c:MovieClip = new Card;
var container:MovieClip = new MovieClip;
container.x = stage.stageWidth/2;
container.y = stage.stageHeight/2+50;
c.stop();
container.addChild(c);
addChild(container);
function shrinkFront():void{
var shrinkCard:Tween = new Tween(container, "scaleX", Strong.easeOut, container.scaleX, -1, 1, true);
shrinkCard.addEventListener(TweenEvent.MOTION_FINI SH, flipGraphic);
}
function expand():void{
var expandCard:Tween = new Tween(container, "scaleX", Strong.easeOut, -1, 1, 1, true);
}
function shrinkBack():void{
var shrinkCardB:Tween = new Tween(container, "scaleX", Strong.easeOut, container.scaleX, -1, 1, true);
shrinkCardB.addEventListener(TweenEvent.MOTION_FIN ISH, flipGraphicB);
}
function clickNext(event:MouseEvent):void
{
shrinkFront();
expand();
}
function flipGraphic(e:TweenEvent):void {
//this doesn't work either ... flipGraphic["onMotionFinished"] = function(){
trace("card shrunk");
c.nextFrame();
c.stop();
if(c.currentFrame == c.totalFrames){
c.gotoAndStop(1);
}
}
//flipGraphic["onMotionFinished"] = function(){
function clickPrev(event:MouseEvent):void{
shrinkBack();
expand();
}
function flipGraphicB(e:TweenEvent):void {
c.prevFrame();
trace("prev clicked");
}