;

PDA

Click to See Complete Forum and Search --> : Colouring... Help


AndrewBacca
11-07-2005, 06:23 AM
Hello,

I have the following code


myColor = new Color (this.snow);
myColor.setRGB(0xff0000);


now that code works create BUT in a text file I have a varible

&scolour=0xff0000

now flash knows the value, because I have tested it with the trace function and it shows "0xff0000".

now what I want is to use that varible "scolour" rather than hard coding it. but the following doesnot work.


myColor = new Color (this.snow);
myColor.setRGB(scolour);


any ideas anyone, im sure its very simple I just cant get it working!

Thanks

Andrew :smoov:

McUsher
11-07-2005, 06:29 AM
When you load it, flash thinks this Color is a String,
so you would have to put:

scolour=parseInt(scolour);

in before using it as a Number.
BUT: The Color-Object is deprecated since Flash8!
Try testing around with the ColourTransform Object

AndrewBacca
11-07-2005, 06:33 AM
thats great thnx alot for the answer and the fast reply :D