import flash.geom / ColorTransform problem

rrbrambley

Born

Posts: 1

3+ Months Ago

I am totally new to flash/actionscript... I was actually assigned to work on a project at work while another guy is on vacation, and none of us here actually know flash, so I'm basically clueless. I am using Flash 8 Professional, and I need to change the color of different components dynamically as I receive CSS data. The guy who previously was working on this had just started on this feature and I found one line where he used setRGB() to set the color of something. I looked in the help files and found that this function is deprecated and that I should use ColorTransform to do the color changes. I've found examples and they all import flash.geom.Transform and flash.geom.ColorTransform, but when I try to impor these, i get the following:

**Error** Scene=intialize, layer=outline, frame=1:Line 9: The class or interface 'flash.geom.Transform' could not be loaded.
import flash.geom.Transform;

**Error** Scene=intialize, layer=outline, frame=1:Line 10: The class or interface 'flash.geom.ColorTransform' could not be loaded.
import flash.geom.ColorTransform;

I am not sure if I actually NEED these import statements, but if I do not use them, then the new ColorTransform objects I create appear to be undefined when I trace. On the other hand, if I do not use the import statements, no errors or anything are printed (I'm not sure if Flash normally would do so).

Anyway, if anyone could direct me in the right direction with this, I'd greatly appreciate it. I'm pretty flash/actionscript illiterate (although fluent in Java), so it'd probably be better if any replies were explained as thorougly as possible, as this flash IDE totally confuses me after having been programming Java for the last couple years.

Thanks a ton!

graphixboy

Control + Z

Posts: 1827

Loc: In the Great White North

3+ Months Ago

I haven't played with the colorTransform (usually use setRGB) However, another way you can change colors is with the LMC_Tween scripts.

http://laco.wz.cz/tween/?page=docs/install

download and install the mxp (flash extension) and then make sure that the lmc_tween.as is in the same directory as the fla.

yourClipInstanceName.colorTo(color, number of seconds for change, ease type);

Color - hex color - 0xFFFFFF etc
Seconds - How long the tween takes set to 0 for instant
Easing Type - I usually use "linear" for color but there are several kinds check the docs.

sandydoc

Born

Posts: 1

3+ Months Ago

If you are getting an error message that flash.geom.ColorTransform won't load, check your Publish settings. The same thing happened to me and I found my flash player was set on 7. When I set it on 8 or 9, I was able to get my program to work when I did a Ctrl/Enter. Good luck