Skip to main content
Participating Frequently
January 12, 2007
Question

Action Script Color Changes

  • January 12, 2007
  • 4 replies
  • 241 views
Hi there.

I have some code that I created off the top of my head to change the color of one of my Pac Man characters to blue after a dot is absorbed, I'm more than sure it's not right, so can someone give me a few pointers on what to do? Thanks

_root.Blinky.color = "0xCC5124";

(That color's not blue anyway)...

THANKS!
This topic has been closed for replies.

4 replies

Darshan_Rane
Inspiring
January 13, 2007
with movieclip symbol there is tint property which you might use
Darshan_Rane
Inspiring
January 13, 2007
with movieclip symbol there is tint property which you might use
Darshan_Rane
Inspiring
January 13, 2007
with movieclip symbol there is tint property which you might use
Inspiring
January 12, 2007
FlashIsTheCoolest123,

> I have some code that I created off the top of my
> head to change the color of one of my Pac Man
> characters

Ooooh! The ActionScript 2.0 Language Reference is only a click away!
Leave the top of your head for more important matters! :)

> I'm more than sure it's not right, so can someone
> give me a few pointers on what to do? Thanks
>
> _root.Blinky.color = "0xCC5124";

Badda bing -- that's ... well, like you said, not right. Assuming
Blinky is a movie clip symbol, that would make it an instance of the
MovieClip class. If you look up the "MovieClip class" entry in the
ActionScript 2.0 Language Reference, you'll find taht movie clips have no
such property as color. Definitely not a bad guess, but the great part is,
you don't *have* to guess when it comes to ActionScript. Consider the
object you're dealing with (movie clip), look up its class, then check out
that class's properties (characteristics of the object), methods (things it
can do), or events (things it can react to). If that leads you nowhere,
re-think the concept. You're dealing with color, so is there a Color class?
Aha ... there is! Check out the sample code in there and see if what you
get.

Write back if you have specific questions.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."