Random Colors in Flash

Want to set something to a random colour in Macromedia Flash? Once upon a time I did, and I found this code which did the trick.

Call changeColor(<target>) to set the color of <target> to a random one

CODE:
  1. function changeColor(targ)
  2. {
  3.  myColor = new Color(targ);
  4.  myColor.setRGB(Math.random()*0xffffff);
  5. }

If you have a website, consider joining the Money4Banners advertising network. They will pay you £10 + £5 each month for displaying a small advert on three of your pages, regardless of traffic. American webmasters are welcome, and since £10 == $20, you make more!


No Responses to “Random Colors in Flash”  

  1. No Comments

Leave a Reply

You must log in to post a comment.


Categories