Jump to content
Search Community

TransformManager[AS3] -Load Previous Transform Item [SOLVED]

danno test
Moderator Tag

Recommended Posts

i'm loading in a previously resized image from a previous session and wanting to know the correct way / order of channging my TransformItem's size to reflect it's previously scaled size.

 

so for my example, i originally loaded in a 200x200 pixel image and assigned it as a TransformItem. After i did my resizing, it was now at 100x100.

upon reloading of that image, i want to load in that 200x200 image again, but then set it to its previous scaled size of 100x100.

 

how would i go about doing that?

thanks!

Link to comment
Share on other sites

I would recommend recording the transform.matrix property values (a, b, c, d, tx, and ty) and re-apply them when you load the image back in. Like myObject.transform.matrix = new Matrix(recorded.a, recorded.b, recorded.c, recorded.d, recorded.tx, recorded.ty);

Link to comment
Share on other sites

in trying to apply the new matrix, it is giving me the following error:

1119: Access of possibly undefined property a through a reference with static type Number.

 

Here's what i have:

 


var testA:Number = .75;
var testB:Number = 0;
var testC:Number = 0;
var testD:Number = .75;
var testX:Number = 0;
var testY:Number = 0;

myObject.transform.matrix = new Matrix(testA.a, testB.b, testC.c, testD.d, testX.tx, testY.ty);

 

help!!

Link to comment
Share on other sites

and i fixed it by doing this instead:

 

var testA:Number = .75;
var testB:Number = 0;
var testC:Number = 0;
var testD:Number = .75;
var testX:Number = 0;
var testY:Number = 0;

myObject.transform.matrix = new Matrix(testA, testB, testC, testD, testX, testY);

 

wahoo!

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