There are 2 problems with my script that I know of
Problem #1:
XML: (PHP FILLS THE $ variables)
<Character>
<CharacterInfo>
<charID>$charID</charID>
<charName>$charName</charName>
<charGuild>$charGuild</charGuild>
<charAge>$charAge</charAge>
<charRace>$charRace</charRace>
<charGender>$charGender</charGender>
<charImage>$charImage</charImage>
<charLocX>$locX</charLocX>
<charLocY>$locY</charLocY>
<charLocF>$locF</charLocF>
</CharacterInfo>
</Character>
if I have CharacterInfo just have it show once it crashes so
I have to have CharacterInfo repeat twice for some reason otherwise
it gives an error.
problem #2: I tried following the PDF, it tells you how to
use variables for panels / datagrids but not how to create a
variable in actionscript so then i could create an if statement and
when the variable exists show a different .mxml file. I just need
help with the converting the xml to a actionscript / flex variable.
Here is the Code:
login.mxml
<mx:HTTPService id="sendLogin" url="
http://www.chimeraonlinerpg.com/CO/XML/login.php"result="loginHandler(event)" useProxy="false" method="POST">
<mx:request xmlns="">
<account>{accountInput.text}</account>
<password>{passwordInput.text}</password>
</mx:request>
</mx:HTTPService>
<mx:StringValidator id="accountValidator"
source="{accountInput}" property="text" maxLength="15"
minLength="5" triggerEvent="help" tooLongError="Account name may
not contain more then 15 alphanumeric characters."
tooShortError="Account name may not contain less then 5
alphanumeric characters."/>
<mx:StringValidator id="passwordValidator"
source="{passwordInput}" property="text" maxLength="15"
minLength="5" triggerEvent="" tooLongError="Password may not
contain more then 15 alphanumeric characters."
tooShortError="Password may not contain less then 5 alphanumeric
characters."/>
<mx:DataGrid dataProvider="{loginData}"/>
<mx:Form width="456" height="245">
<mx:Panel width="100%" height="200" layout="absolute"
title="Account Login">
<mx:Label text="Password:" x="19" y="60"/>
<mx:FormItem required="true" x="115" y="34"
width="174">
<mx:TextInput id="accountInput"/>
</mx:FormItem>
<mx:Label text="Account Name:" x="19" y="34"/>
<mx:FormItem required="true" x="115" y="64">
<mx:TextInput id="passwordInput"
displayAsPassword="true"/>
</mx:FormItem>
<mx:Button id="buttonLogin" label="Login"
click="sendLogin.send()" x="174" y="94"/>
</mx:Panel>
</mx:Form>
functions.as
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
import flash.xml.XMLNode;
[Bindable]
private var tileData:ArrayCollection;
[Bindable]
private var loginData:ArrayCollection;
private function resultHandler(event:ResultEvent):void {
tileData = event.result.tiles.tile;
}
private function loginHandler(event:ResultEvent):void {
loginData = event.result.Character.CharacterInfo;
}