ACTIONSCRIPT 2 - Send MovieClip colour value to dynamic text box
Hi,
I've been struggling to figure this bit out and it's driving me crazy.
What happens in my flash file is I click on a colour swatch and that colour is then stored until I click on the part of the shirt I want to change colour. Once that part of the jersey has changed colour I want to be able to send the colour from just that section to a dynamic text field (to be emailed later as a reference). As an example, I click on "btn_orange" and then click on the Movie Clip "block1". "block1" changes to orange. As it changes I want to send "block1"'s colour to a text box called "hexcode1". If "block1" colour changes, then so will the text box "hexcode1". "block2" will be linked to "hexcode2" etc.
Hopefully this explains it better. I would really appreciate any help as this is the major thing holding me back from completing this.
Thanks for checking this out.
Code:
var storedColor:String;
color_txt.html = true;
color_txt.autoSize = true;
color_txt.htmlText = "Choose a color swatch";
function setSwatchColor(colorNum:String):Void {
storedColor = colorNum;
var swatch:Color = new Color(swatch_mc);
swatch.setRGB(parseInt(colorNum));
color_txt.htmlText = colorNum;
}
function changeColor():Void {
var col:Color = new Color(this);
col.setRGB(parseInt(storedColor));
}
btn_maroon.onPress = function() {
setSwatchColor("0x660033");
};
btn_red.onPress = function() {
setSwatchColor("0xFF0000");
};
btn_orange.onPress = function() {
setSwatchColor("0xFF6600");
};
block1.onPress = changeColor;
block2.onPress = changeColor;
http://i50.tinypic.com/ir23km.jpg