Jump to content
Search Community

swap page transition please help.

Asteroids test
Moderator Tag

Recommended Posts

Yeah, the transition can definitely be created using GreenSock tools. 

Its really just a combination of tweening some 3D rotations, scale and positional properties at the right time. The only real trick is getting the elements to swap depths.

 

We really don't build a lot of custom effects as support but here is a general idea:

 

import com.greensock.*;

var tl = new TimelineLite();


card2.scaleX = card2.scaleY = 0.8
tl.to(card1, 1, {rotationY:-20, x:"-=200"})
  .to(card2, 1, {rotationY:20, x:"+=200", scaleX:1, scaleY:1}, 0)
  .to(card2, 1, {rotationY:0, x:"-=200"}, "swap")
  .call(this.addChild, [card2], "swap")
  .to(card1, 1, {rotationY:0, x:"+=200", scaleX:0.8, scaleY:0.8}, "swap")

With all animations it can take a lot of time tweaking the values to be perfect. This was a very quick stab.

 

Flash CC fla and swf attached. If you don't have CC just create a new fla and place 2 movie clips on top of each other with instance names card2 (bottom) card1 (top). You should be able to open the swf. Silly Flash CC won't let you save to any earlier versions.

 

 

 

 

 

3Dtransition_CC.zip

Link to comment
Share on other sites

import com.greensock.*;

 

 

var tl = new TimelineMax();

 

 

  

tl.insert(TweenLite.to(card1, 1, {rotationY:-20, x:"-200"}))

tl.insert(TweenLite.to(card2, 1, {rotationY:20, x:"200", scaleX:1, scaleY:1}))

tl.insert(TweenLite.to(card2, 1, {rotationY:0, x:"-200"}), 1)

tl.addCallback(this.addChild, 1, [card2])

tl.insert(TweenLite.to(card1, 1, {rotationY:0, x:"200", scaleX:0.8, scaleY:0.8}), 1)

  • Like 1
Link to comment
Share on other sites

import com.greensock.*;


var tl = new TimelineMax();


  
tl.insert(TweenLite.to(card1, 1, {rotationY:-20, x:"-200"}))
tl.insert(TweenLite.to(card2, 1, {rotationY:20, x:"200", scaleX:1, scaleY:1}))
tl.insert(TweenLite.to(card2, 1, {rotationY:0, x:"-200"}), 1)
tl.addCallback(this.addChild, 1, [card2])
tl.insert(TweenLite.to(card1, 1, {rotationY:0, x:"200", scaleX:0.8, scaleY:0.8}), 1)

 

thank you again.

 

you are my hero!!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...