I have a flash variable scope question, and I’m not sure how to reference the variable.
In my text file is &myColor=blue
The three movie instances don’t want to change color based on the loaded text variable. Perhaps you can shed some light.
I’m trying to fix this so designers have options for color, but are set with particular brand colors.
#include "lmc_tween.as"
var fadeTime:Number = 2;
loadText = new LoadVars();
loadText.load("assets/description.txt");
loadText.onLoad = function() {
middle_bg._alpha = 20;
my_color = this.myColor;
switch (my_color) {
case "teal" :
trace("teal");
theColor = "0x156570";
break;
case "blue" :
trace("blue");
theColor = "0x44697D";
break;
case "green" :
trace("green");
theColor = "0x496C60";
break;
case "grey" :
trace("grey");
theColor = "0x666666";
break;
default :
trace("the default value");
theColor = "0x666666";
break;
}
//theColor = 0xFF0000;
top_bg.colorTo(theColor, fadeTime, easeInOut);
middle_bg.colorTo(theColor, fadeTime, easeInOut);
bottom_bg.colorTo(theColor, fadeTime, easeInOut);
};