Home > Software engineering >  How to call upon a color transform in AS3
How to call upon a color transform in AS3

Time:05-13

If I use colortransform to set a color to an object is there any way I can call on that color through the parent?

for example

var color1 = new ColorTransform(); color1.color = 0xFF0000;
thing1.transform.colorTransform = color1;

If I want to call upon that color assigned to thing1 is there any way to do that?

Some things I have tried

trace(thing1.color);
trace(thing1.colorTransform);
trace(thing1.transform);

CodePudding user response:

I found an alternative that you can call upon that may actually solve most desired functionality.

if you take the object and attach .transform.colorTransform to the end you can call upon any of the 8 values set to that object by the color transform function

trace(thing1.transform.colorTransform);
trace(thing1.transform.colorTransform.blueOffset);

or call a value to relay it to another variable

color2.blueOffset = thing1.transform.colorTransform.blueOffset;
  • Related