Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading a variable from external file and using it in actionscript

Status
Not open for further replies.

timtom

Programmer
Jul 12, 2001
78
GB
Hello
I'm using a button to change the button of a box like this...

on (release) {
myColor = new Color(_root.mybox);
var x;
x= 0xfff545
myColor.setRGB(x);
}


This works fine, and when I press the button the box changes to a yellow color. HOWever, what I'm really trying to do is get the exact RGB color from an external file and load it as a variable. I'm fine loading the variable and writing it to the screen in a dynamic text field using the following method...


on (release) {
loadVariablesNum("var.asp", 0);


There's a variable in there called C1, but when I try...

on (release) {
loadVariablesNum("var.asp", 0);
myColor = new Color(_root.mybox);

//var C1 with or without this line, neither work

myColor.setRGB(C1);
}


It doesn't work! Please could someone tell me how I can get the variable C1 (which contains a valid hex color formatted correctly) inside the setRGB brackets. I would be extremely grateful.

Thanks a lot for looking
Sarah
 
myColor.setRGB(C1).toString(16);


ought to do it have to tell flash its its in hex(base 16)


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top