Answered
Change Movie Clip Color with External Variable
I have a movieclip in my flash file (WhiteBarMC) that I want
to be able to change colors on using a variable (hexidecimal
number) assigned from an external file. I found a script that gets
closer to what I want to achieve, but I'm not sure how to execute
the alterations I need to make it work.
on (rollOver) {
var colorful = new Color("_root.WhiteBarMC");
colorful.setRGB(0x006699);
}
This is close because it changes my object/Movie Clip on roll over. BUT, I have two problems...
1) I want to set the hex-color code in an external file as a variable that flash retrieves and then applies to this movieclip. If it helps to explain why, it's because I have multiple variations of this swf throughout my site with different text overlaying the colored movieclip bar (i.e. galleries, contact, about, etc.) So, with one change in an external file, I have the ability to change the color bars globally to match changing color schemes on the site.
I set up an external ".txt" file with only "var myColor=CC0033" in the file. I'm not sure if that's right, or even the right method, but I thought it would help you smarter ones to know what I'm doing.
2) I don't want my viewers to have to "roll over" it to actuate the change. I want it to happen on load.
ANYONE who can help is a hero. Remember, I'm not that proficient at action script, so a little guidance and clarity in your response will help immensley! I owe you a dinner!
on (rollOver) {
var colorful = new Color("_root.WhiteBarMC");
colorful.setRGB(0x006699);
}
This is close because it changes my object/Movie Clip on roll over. BUT, I have two problems...
1) I want to set the hex-color code in an external file as a variable that flash retrieves and then applies to this movieclip. If it helps to explain why, it's because I have multiple variations of this swf throughout my site with different text overlaying the colored movieclip bar (i.e. galleries, contact, about, etc.) So, with one change in an external file, I have the ability to change the color bars globally to match changing color schemes on the site.
I set up an external ".txt" file with only "var myColor=CC0033" in the file. I'm not sure if that's right, or even the right method, but I thought it would help you smarter ones to know what I'm doing.
2) I don't want my viewers to have to "roll over" it to actuate the change. I want it to happen on load.
ANYONE who can help is a hero. Remember, I'm not that proficient at action script, so a little guidance and clarity in your response will help immensley! I owe you a dinner!
