This code for a painting game is getting a bit lengthy. Is there a way to abbreviate it? The targets “/w” etc are movie clips of paint colour, the labels are different states within the paintbrush movie clip (to show current paint colour), and the targets a1-b22 are areas of the pictures which change colour. Thanks.
on (press) {
startDrag ("_root.brush");
}
on (release) {
stopDrag ();
if (_root.brush._droptarget == “/w”) {
_root.brush.gotoandStop(“w”);
}
if (_root.brush._droptarget == “/bs”) {
_root.brush.gotoandStop(“bs”);
}
if (_root.brush._droptarget == “/g”) {
_root.brush.gotoandStop(“g”);
}
if (_root.brush._droptarget == “/gp”) {
_root.brush.gotoandStop(“gp”);
}
if (_root.brush._droptarget == “/t”) {
_root.brush.gotoandStop(“t”);
}
if (_root.brush._droptarget == “/fl”) {
_root.brush.gotoandStop(“fl”);
}
if (_root.brush._droptarget == “/pt”) {
_root.brush.gotoandStop(“pt”);
}
if (_root.brush._droptarget == “/m”) {
_root.brush.gotoandStop(“m”);
}
if (_root.brush._droptarget == “/ob”) {
_root.brush.gotoandStop(“ob”);
}
if (_root.brush._droptarget == “/rb”) {
_root.brush.gotoandStop(“rb”);
}
if (_root.brush._droptarget == “/bs”) {
_root.brush.gotoandStop(“bs”);
}
if (_root.brush._droptarget == “/r”) {
_root.brush.gotoandStop(“r”);
}
if (_root.brush._droptarget == “/pu”) {
_root.brush.gotoandStop(“pu”);
}
if (_root.brush._droptarget == “/o”) {
_root.brush.gotoandStop(“o”);
}
if (_root.brush._droptarget == “/pi”) {
_root.brush.gotoandStop(“pi”);
}
if (_root.brush._droptarget == “/br”) {
_root.brush.gotoandStop(“br”);
}
if (_root.brush._droptarget == “/w”) {
_root.brush.gotoandStop(“w”);
}
if (_root.brush._droptarget == “/y”) {
_root.brush.gotoandStop(“y”);
}
if (_root.brush._droptarget == “/nb”) {
_root.brush.gotoandStop(“nb”);
}
if (_root.brush._droptarget == “/a1”) {
_root.a1_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a2”) {
_root.a2_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a3”) {
_root.a3_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a4”) {
_root.a4_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a5”) {
_root.a5_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a6”) {
_root.a6_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a7”) {
_root.a7_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a8”) {
_root.a8_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a9”) {
_root.a9_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a10”) {
_root.a10_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a11”) {
_root.a11_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a12”) {
_root.a12_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a13”) {
_root.a13_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a14”) {
_root.a14_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a15”) {
_root.a15_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a16”) {
_root.a16_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a17”) {
_root.a17_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a18”) {
_root.a18_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a19”) {
_root.a19_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a20”) {
_root.a20_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a21”) {
_root.a21_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/a22”) {
_root.a22_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b1”) {
_root.b1_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b2”) {
_root.b2_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b3”) {
_root.b3_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b4”) {
_root.b4_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b5”) {
_root.b5_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b6”) {
_root.b6_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b7”) {
_root.b7_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b8”) {
_root.b8_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b9”) {
_root.b9_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b10”) {
_root.b10_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b11”) {
_root.b11_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b12”) {
_root.b12_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b13”) {
_root.b13_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b14”) {
_root.b14_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b15”) {
_root.b15_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b16”) {
_root.b16_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b17”) {
_root.b17_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b18”) {
_root.b18_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b19”) {
_root.b19_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b20”) {
_root.b20_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b21”) {
_root.b21_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/b22”) {
_root.b22_color.setRGB(0xFF8211);
}
if (_root.brush._droptarget == “/home”) {
tellTarget ("/") {
gotoAndStop (“Scene 1”, “home”);
}
}
}