GosuFlex
07-27-2009, 07:07 PM
Hello,
I just caught on to the Flex phenomenon and I'm having problems compiling this little application. It's just supposed to be a simple form and when you click the submit button, an alert box will open with the name and age of the user.
It keeps saying there's a 'illegal character on line 11', but from the book I've been reading. I have not seen where this is located. Could anyone give me insight please?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel x="181" y="68" width="332" height="267" layout="absolute">
<mx:Label x="21" y="0" text="My name is:"/>
<mx:TextInput id="fullNameTextInput" text="John Doe" x="21" y="25"/>
<mx:Label x="21" y="55" text="My age is:" id="ageLabel"/>
<mx:NumericStepper id="ageNS" maximum="120" minimum="18" x="21" y="70"/>
<mx:CheckBox x="21" y="100" label="I'm a Flex Expert"/>
<mx:Button x="20" y="130" label="Submit" click="showInfo()"/>
</mx:Panel>
</mx:Application>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function showInfo():void
{
Alert.show("Your name is " + fullNameTextInput.text +" and your age is " + ageNS.value);
}
]]>
</mx:Script>
I just caught on to the Flex phenomenon and I'm having problems compiling this little application. It's just supposed to be a simple form and when you click the submit button, an alert box will open with the name and age of the user.
It keeps saying there's a 'illegal character on line 11', but from the book I've been reading. I have not seen where this is located. Could anyone give me insight please?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel x="181" y="68" width="332" height="267" layout="absolute">
<mx:Label x="21" y="0" text="My name is:"/>
<mx:TextInput id="fullNameTextInput" text="John Doe" x="21" y="25"/>
<mx:Label x="21" y="55" text="My age is:" id="ageLabel"/>
<mx:NumericStepper id="ageNS" maximum="120" minimum="18" x="21" y="70"/>
<mx:CheckBox x="21" y="100" label="I'm a Flex Expert"/>
<mx:Button x="20" y="130" label="Submit" click="showInfo()"/>
</mx:Panel>
</mx:Application>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
public function showInfo():void
{
Alert.show("Your name is " + fullNameTextInput.text +" and your age is " + ageNS.value);
}
]]>
</mx:Script>