showriter4
October 8th, 2008, 10:17 PM
Hey guys,
I have what is probably a fairly easy issue. I'm trying to color movie clips, but since i'm coloring more than one movie clip, it's looping through them all and passing the movie clip instance name that needs to be colored in a variable. Flash is trying to read the variable name as the movie clip instance name in the function, not interpreting it as a variable. is there some syntax to let Flash know it's a variable name that the value needs to be read and interpreted? see below:
function colorDarkBlue(postal:String):void {
trace(postal);
var stateToShade:String = postal + "_mc";
var colorTransform:ColorTransform = this.us_map.stateToShade.transform.colorTransform;
colorTransform.color = 0x003399;
this.us_map.stateToShade.transform.colorTransform = colorTransform;
trace("color it dark blue");
}
function colorDarkBlue(postal:String):void {
trace(postal);
var stateToShade:String = postal + "_mc";
var colorTransform:ColorTransform = this.us_map.stateToShade.transform.colorTransform;
colorTransform.color = 0x003399;
this.us_map.stateToShade.transform.colorTransform = colorTransform;
trace("color it dark blue");
}and sorry about the messiness....
-Stephanie
I have what is probably a fairly easy issue. I'm trying to color movie clips, but since i'm coloring more than one movie clip, it's looping through them all and passing the movie clip instance name that needs to be colored in a variable. Flash is trying to read the variable name as the movie clip instance name in the function, not interpreting it as a variable. is there some syntax to let Flash know it's a variable name that the value needs to be read and interpreted? see below:
function colorDarkBlue(postal:String):void {
trace(postal);
var stateToShade:String = postal + "_mc";
var colorTransform:ColorTransform = this.us_map.stateToShade.transform.colorTransform;
colorTransform.color = 0x003399;
this.us_map.stateToShade.transform.colorTransform = colorTransform;
trace("color it dark blue");
}
function colorDarkBlue(postal:String):void {
trace(postal);
var stateToShade:String = postal + "_mc";
var colorTransform:ColorTransform = this.us_map.stateToShade.transform.colorTransform;
colorTransform.color = 0x003399;
this.us_map.stateToShade.transform.colorTransform = colorTransform;
trace("color it dark blue");
}and sorry about the messiness....
-Stephanie