Jump to content
Search Community

z axis

lochmann test
Moderator Tag

Recommended Posts

Hi

Im pretty new to tweenmax.

Is it possible to order objects in z dimension? a bit like z-index in HTML.

I have four objects which animate one at a time to the center of stage, but the overlap.

I want to set the moving box to the front.

 

My code look like this:

 

//as2 code

import com.greensock.*;

 

var timeline:TimelineMax = new TimelineMax({repeat:-1, yoyo:false, repeatDelay:5});

 

timeline.append(new TweenMax(box1, 1.0, {_rotation:"15", _xscale:150, _yscale:150, _x:"80", _y:"-50", ease:Back.easeOut, delay: 2}));

timeline.append(new TweenMax(box1, 1.0, {_rotation:"-15", _xscale:100, _yscale:100, _x:"-80", _y:"50", ease:Back.easeOut, delay: 2}));

 

 

timeline.append(new TweenMax(box2, 1.0, {_rotation:"-15", _xscale:150, _yscale:150, _x:"-160", _y:"50", ease:Back.easeOut, delay: 2}));

timeline.append(new TweenMax(box2, 1.0, {_rotation:"15", _xscale:100, _yscale:100, _x:"160", _y:"-50", ease:Back.easeOut, delay: 2}));

 

timeline.append(new TweenMax(box3, 1.0, {_rotation:"15", _xscale:150, _yscale:150, _x:"80", _y:"-50", ease:Back.easeOut, delay: 2}));

timeline.append(new TweenMax(box3, 1.0, {_rotation:"-15", _xscale:100, _yscale:100, _x:"-80", _y:"50", ease:Back.easeOut, delay: 2}));

 

timeline.append(new TweenMax(box4, 1.0, {_rotation:"-15", _xscale:150, _yscale:150, _x:"-160", _y:"-50", ease:Back.easeOut, delay: 2}));

timeline.append(new TweenMax(box4, 1.0, {_rotation:"15", _xscale:100, _yscale:100, _x:"160", _y:"50", ease:Back.easeOut, delay: 2}));

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...