flash random Q...
- Started
- Last post
- 4 Responses
- Dno
Alright All,
Do any of you flash heads know how I can do the following.
I have an fla that uses a movieclip exported from the library as "cercle2" it is used and duplicated as part of the navigation.
What I want to do is randomly change the colour of the circle when it is imported into the movie. so as each duplicate is a different colour. Does that make sense?
Can anyone point me in the right direction please?
Thanks in anticipation.
D
- SirG0
You can change the color of any movieclip with the color object in Flash: http://www.macromedia.com/suppor… (setRGB or setTransform for more control)
- Dno0
...thanks for that SirG :)
Trying to work out how to make it work when exporting/importing from the library though!
any ideas?
- davi-t0
Create an array (ie. colorArray) with the color hex's you want to use (having random colors can mean you can get colors that are different but look the same). Create Movieclip Subclass for your "cercle_mc". Create subclass constructor to randomly change the color of the duplicated clip using setRGB and your colorArray, think Robert Penner has a niice script to do that. Associate your "cercle_mc" with the new class.
There's a bunch of ways you can do this. I'm sure there's a tute out there.
davi-t