Re: [Flashcoders] Tween a matrix transformation

2009-05-01 Thread Hans Wichman
Hi,

there is probably a better way, but one solution is to do: x* state1Matrix +
(x-1)*state2Matrix and tween x over 0..1

greetz
JC

On Fri, May 1, 2009 at 4:31 PM, Mendelsohn, Michael 
michael.mendels...@fmglobal.com wrote:

 Hi list...

 I'm trying to think of the best way to tween a sprite that's been
 transformed, with all 6 props of its matrix property having been altered.  I
 use TweenLite a lot...should I write 6 lines of code, one for each matrix
 property?

 Any suggestions for the most optimal way to tween a matrix transform?

 Thanks,
 - Michael M.

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Tween a matrix transformation

2009-05-01 Thread Jack Doyle
You could do this:

var matrix:Matrix = mc.transform.matrix;

TweenLite.to(matrix, 1, {a:1.5, b:0.2, c:0.2, d:1.5, tx:100, ty:100,
onUpdate:applyMatrix, onUpdateParams:[mc, matrix]});

function applyMatrix($mc:DisplayObject, $matrix:Matrix):void {
$mc.transform.matrix = $matrix; //for changes in the matrix to take
effect, it must be re-applied.
}

Jack

-Original Message-
From: Mendelsohn, Michael [mailto:michael.mendels...@fmglobal.com] 
Sent: Friday, May 01, 2009 9:31 AM
To: Flash Coders List
Subject: [Flashcoders] Tween a matrix transformation

Hi list...

I'm trying to think of the best way to tween a sprite that's been
transformed, with all 6 props of its matrix property having been altered.  I
use TweenLite a lot...should I write 6 lines of code, one for each matrix
property? 

Any suggestions for the most optimal way to tween a matrix transform?

Thanks,
- Michael M.




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Tween a matrix transformation

2009-05-01 Thread Joel Stransky

As with everything else you beat me to it Jack. Congrats on v11!

--Joel

On May 1, 2009, at 10:04 AM, Jack Doyle j...@greensock.com wrote:


You could do this:

var matrix:Matrix = mc.transform.matrix;

TweenLite.to(matrix, 1, {a:1.5, b:0.2, c:0.2, d:1.5, tx:100, ty:100,
onUpdate:applyMatrix, onUpdateParams:[mc, matrix]});

function applyMatrix($mc:DisplayObject, $matrix:Matrix):void {
   $mc.transform.matrix = $matrix; //for changes in the matrix to take
effect, it must be re-applied.
}

Jack

-Original Message-
From: Mendelsohn, Michael [mailto:michael.mendels...@fmglobal.com]
Sent: Friday, May 01, 2009 9:31 AM
To: Flash Coders List
Subject: [Flashcoders] Tween a matrix transformation

Hi list...

I'm trying to think of the best way to tween a sprite that's been
transformed, with all 6 props of its matrix property having been  
altered.  I
use TweenLite a lot...should I write 6 lines of code, one for each  
matrix

property?

Any suggestions for the most optimal way to tween a matrix transform?

Thanks,
- Michael M.




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Tween a matrix transformation

2009-05-01 Thread Mendelsohn, Michael
Wow, straight from the source!
Cheers Jack!

- MM


 You could do this:

 var matrix:Matrix = mc.transform.matrix;

 TweenLite.to(matrix, 1, {a:1.5, b:0.2, c:0.2, d:1.5, tx:100, ty:100,
 onUpdate:applyMatrix, onUpdateParams:[mc, matrix]});

 function applyMatrix($mc:DisplayObject, $matrix:Matrix):void {
$mc.transform.matrix = $matrix; //for changes in the matrix to take
 effect, it must be re-applied.
 }

 Jack


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders