How do I convert hex number to rgb?
My user is using a colourpicker to select the colour. I then want to use that picked colour to change an objects colour via colour transform. But colourTransform wants an RGB version of the colour.
My user is using a colourpicker to select the colour. I then want to use that picked colour to change an objects colour via colour transform. But colourTransform wants an RGB version of the colour.
Well I have tried it without the 0x but I'm still getting the error. This is my code
var cardDetails:Array = new Array(); cardDetails['catColour']=petColour.selectedColor;
var catColour:ColorTransform = new ColorTransform()
catColour=cardDetails['catColour'];
viewCardScreen.catBody_mc.transform.colorTransform=catColour
Error is TypeError: Error #1034: Type Coercion failed: cannot convert 0 to flash.geom.ColorTransform. - so somehow my value isn't the right type for the colourTransform which is why I thought ti needed to be in RGB format.
Your value might be right, but your code isn't.
catColour=cardDetails['catColour'];
catColour is a colorTransform object... you probably want catColour.color =
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.