This is an example of the code I have.
When the mobile application opens, you can type your desired colour (E.g. #811fb4 for a purple-ish colour), and when you click the button it should change the label colour.
However lbl1.color does not work. Any ideas?
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Custom Colour">
<fx:Script>
<![CDATA[
public var customColourChosen:String;
protected function button1_clickHandler(event:MouseEvent):void{
customColourChosen = txtInput1.text;
lbl1.color = customColourChosen; // <------ //
}
]]>
</fx:Script>
<s:Label id="lbl1" x="144" y="104" fontSize="36" text="Label"/>
<s:TextInput id="txtInput1" x="50" y="138"/>
<s:Button x="124" y="212" label="Button" click="button1_clickHandler(event)"/>
</s:View>
this way you can even use purple I think.. 🙂