Jump to content
GreenSock

jr_blackridge

.from and transformMatrix ?

Recommended Posts

I want to use .from and transformMatrix. Is this possible, or can I only transform .to ?

 

TweenLite.from(mc, 1.5, {transformMatrix:{_x:-349, _y:-129, _xscale:1, _yscale:1}});

Link to comment
Share on other sites

Sure, you can do a from() tween with transformMatrix. Just don't forget to activate the plugin first.

 

import com.greensock.plugins.*;
TweenPlugin.activate([TransformMatrixPlugin]);

Link to comment
Share on other sites

Ok, but only if the mc hasn't had any tweens prior?

Very simply - I want to tween the mc from _alpha:0

and then later in timeline use transformMatrix on the same mc

 

The only way I could get from() to work is by moving the mc to another layer. But to() works without moving the mc

 

so on frame 1 place mc on layer 1

 

import com.greensock.*;

import com.greensock.easing.*;

TweenLite = TweenLite.from(mc, 1.5, { _alpha:0});

 

//and then on frame 35 move mc to layer 2

 

trace("hello");

import com.greensock.*;

import com.greensock.plugins.*;

import com.greensock.easing.*;

TweenPlugin.activate([TransformMatrixPlugin]);

 

TweenLite.from(mc, 1.5, {transformMatrix:{_x:-349, _y:-129, _xscale:100, _yscale:100}});

 

And then it works.

 

But I can do a to() if I don't change layers.

Link to comment
Share on other sites

It appears to work perfectly for me. But keep in mind that once you edit an object with ActionScript, it essentially "disconnects" it from the Flash timeline. (that has nothing to do with TweenLite/Max by the way). Were you expecting to do the alpha tween on the first 34 frames and then have the object move to the position you set on the timeline? No can do. If you name the instance something else on frame 35, however, that'll tell Flash to treat it as a different object/instance. Don't forget to adjust your tween's target to reflect that new instance name and then you should be golden.

Link to comment
Share on other sites

I guess I'm surprised that it works for you. I'm on a different machine and it doesn't work here either.

 

Changing the instance name effectively does the same as changing the layer, so that doesn't surprise.

 

I thought I understood that the clip "detaches" from the timeline. But maybe I don't. I thought that I could effectively "reset" it with a new instance of the same clip at a new _x, _y, scale, etc. and then do a tween.from() based on the new keyframe.

 

But what you are saying is that since the clips are on the same layer, and contiguous, actionscript still has hold of the clip. I see you are right from a basic test without greensock classes.

 

Ok, I'm a little wiser. I've got a couple of different strategies for approaching what I want to do.

Thanks for the support.

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