The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Web Design
> Flash Help
|
Page 3d Flip
Discuss Page 3d Flip in the Flash Help forum on Dev Shed. Page 3d Flip Flash Help forum discussing all products originally created by Macromedia including DreamWeaver, Contribute, Flash, Fireworks, Freehand, Director, Authorware and HomeSite. Adobe bought Macromedia in 2005.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

December 2nd, 2012, 10:16 AM
|
|
Registered User
|
|
Join Date: Dec 2012
Posts: 1
Time spent in forums: 11 m 56 sec
Reputation Power: 0
|
|
|
Page 3d Flip
hi
Just a question on how to flip 3d pages heres my code so far but wen i click on alarm btn it goes to side c instead of going side b any help??
Code:
import fl.transitions.Tween; import fl.transitions.easing.Strong; import fl.transitions.TweenEvent; var isStill:Boolean = true; var isStill2:Boolean = true; var isStill3:Boolean = true; var isStill4:Boolean = true; var arraytween:Array=new Array(); var arraytween2:Array=new Array(); var arraytween3:Array=new Array(); var arraytween4:Array=new Array(); function onalarm_clicked(e:MouseEvent):void{ gotoAndStop ("sideb"); } function calender_clicked(e:MouseEvent):void{ gotoAndStop ("sidec"); } /*function stopwatch_clicked(e:MouseEvent):void{ gotoAndStop ("con.sidec"); } function analog_clicked(e:MouseEvent):void{ gotoAndStop ("con.sided"); } function digital_clicked(e:MouseEvent):void{ gotoAndStop ("con.sidee"); }*/ con.sidea.alarm.addEventListener(MouseEvent.CLICK,onalarm); con.sidea.calender.addEventListener(MouseEvent.CLICK,oncalender); //con.sidea.stopwatch.addEventListener(MouseEvent.CLICK,onstopwatch); //con.sidea.analog.addEventListener(MouseEvent.CLICK,onanalog); //con.sidea.digital.addEventListener(MouseEvent.CLICK,ondigital); con.sideb.flip.addEventListener(MouseEvent.CLICK,onflip); con.sidec.flip2.addEventListener(MouseEvent.CLICK,onflip2); //con.sided.flip3.addEventListener(MouseEvent.CLICK,onflip3); //con.sidee.flip4.addEventListener(MouseEvent.CLICK,onflip4); addEventListener(Event.ENTER_FRAME,loop); addEventListener(Event.ENTER_FRAME,loop2); addEventListener(Event.ENTER_FRAME,loop3); addEventListener(Event.ENTER_FRAME,loop4); function onalarm(e:Event) { if (isStill) { arraytween.push(new Tween(con,'rotationY',Strong.easeInOut,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 >= 90 && con.rotationY <= 270) { con.addChild(con.sideb); con.scaleX = -1; }else{ con.addChild(con.sidea); con.scaleX = 1; } if (con.rotationY >= 360) { con.rotationY = 0; } } function onflip(e:Event) { if (isStill2) { arraytween2.push(new Tween(con,'rotationY',Strong.easeInOut,con.rotationY,con.rotationY+180,1,true)); arraytween3[0].addEventListener(TweenEvent.MOTION_FINISH,reset2); isStill2 = false; } } function reset2(e:Event) { isStill2 = true; arraytween2 = []; } function loop2(e:Event) { if (con.rotationY >= 90 && con.rotationY <= 270) { con.addChild(con.sideb); con.scaleX = -1; }else{ con.addChild(con.sideb); con.scaleX = 1; } if (con.rotationY >= 360) { con.rotationY = 0; } } function oncalender(e:Event) { if (isStill3) { arraytween3.push(new Tween(con,'rotationY',Strong.easeInOut,con.rotationY,con.rotationY+180,1,true)); arraytween3[0].addEventListener(TweenEvent.MOTION_FINISH,reset3); isStill3 = false; } } function reset3(e:Event) { isStill = true; arraytween3 = []; } function loop3(e:Event) { if (con.rotationY >= 90 && con.rotationY <= 270) { con.addChild(con.sidea); con.scaleX = -1; }else{ con.addChild(con.sidec); con.scaleX = 1; } if (con.rotationY >= 360) { con.rotationY = 0; } } function onflip2(e:Event) { if (isStill4) { arraytween4.push(new Tween(con,'rotationY',Strong.easeInOut,con.rotationY,con.rotationY+180,1,true)); arraytween4[0].addEventListener(TweenEvent.MOTION_FINISH,reset4); isStill4 = false; } } function reset4(e:Event) { isStill4 = true; arraytween4 = []; } function loop4(e:Event) { if (con.rotationY >= 90 && con.rotationY <= 270) { con.addChild(con.sidec); con.scaleX = -1; }else{ con.addChild(con.sidea); con.scaleX = 1; } if (con.rotationY >= 360) { con.rotationY = 0; } }
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|