Web
Article

Flash Script – Change a Movieclip’s Color in Flash

By Georgina Laidlaw

Download the sample files here.

1. Create a large rectangle.

2. Convert the rectange to a movie clip, and give it an instance name of "rectangle".

3. Create a small square button.

4. Create a small text field, and give it a variable name "hexcode".

5. Assign the button the folliowing action:

on (release)  
{  
colorchange = new Color("/rectangle");  
colorchange.setRGB(0xff33cc);  
}  
on (release)  
{  
hexcode = (colorchange.getRGB()).toString(16);  
}

6. You’re done! Press ctrl+enter to check the movie.

No Reader comments

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Instant Website Review

Use Woorank to analyze and optimize your website to improve your website to improve your ranking!

Run a review to see how your site can improve across 70+ metrics!

Get the latest in Front-end, once a week, for free.