Another color question

hi,

I’m having 8 different color crayon Movie Clips and about 15through20 MC icons
and when i drag a crayon, lets say is red, I want it to color the movie clip it touches when released now my problem is that there are several MC icons and it would take me a long time to write conditions for all like this:

redcrayon

[AS]
on(release){
if(this.hitTest(_parent.MC1)){
myColoredObject = new Color (_root.MC1);
myColoredObject.setRGB(0xFF0000);

}else if(this.hitTest(_parent.MC2)){
myColoredObject = new Color (_root.MC2);
myColoredObject.setRGB(0xFF0000);
}
//etc…
[/AS]

any ideas how can i do this without doing this for all crayons
thanks C:-) :thumb:

on (release) {
	var my_mc, my_color;
	if (my_mc=eval(this._droptarget)) {
		my_color = new Color(my_mc);
		my_color.setRGB(0xff0000);
	}
}

… Does that help? :stuck_out_tongue:

Thanks kode!!! you’re a genious !!!

You’re welcome. :beam: