import flash.geom / ColorTransform problem

  • rrbrambley
  • Born
  • Born
  • rrbrambley
  • Posts: 1

Post 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
  • Mastermind
  • User avatar
  • Posts: 1825
  • Loc: In the Great White North

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

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

set the first line of your actionscript to

Code: [ Select ]
#include ""

This just causes the functions in that document to be included in your script at compile time.

now you can change the color pretty easily

Code: [ Select ]
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
  • Born
  • sandydoc
  • Posts: 1

Post 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

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 2 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.