Tuesday, March 30, 2010

Simple Flip of two images flashing

This code works in Flash ide and IE8.?In Firefox and Google chrome after flipping once it just starts to flash.

import fl.transitions.Tween;

import fl.transitions.easing.Strong;

import fl.transitions.TweenEvent;

con.sidea.flip.addEventListener(MouseEvent.CLICK,onflip);

con.sideb.flip.addEventListener(MouseEvent.CLICK,onflip);

addEventListener(Event.ENTER_FRAME,loop);

var isStill:Boolean=true;

var arraytween:Array = new Array();

function onflip(e:Event) {

if (isStill) {

arraytween.push(new Tween(con,'rotationY',Strong.easeOut,con.rotationY,con.rotationY+180,1,true));

arraytween[0].addEventListener(TweenEvent.MOTION_FINISH,reset);

isStill=false;

}

}

function reset(e:Event) {

?isStill=true;

arraytween=[];

}

function loop(e:Event) {

if (con.rotationY%26gt;=90 %26amp;%26amp; con.rotationY%26lt;=270) {

con.addChild(con.sideb);

con.scaleX=-1;

?} else {

con.addChild(con.sidea);

con.scaleX=1;

}

?if (con.rotationY%26gt;=360) {

con.rotationY=0;

?}

}

Thanks, Need your help....

Simple Flip of two images flashing

No bites yet.

Really need you help.

No comments:

Post a Comment