Load MySQL query into swf
Greetings all,
Hoping someone can help with my probem.
I have data being loaded into MySQL database from my swf and I am attempting to read back specific data which will be used to determine if a button object will be active or not, basically forcing users to complete an item before they can do another.
Anyway, my code is below:
PHP is providing the following results from my query via print:
"userid","M01","M02","M03","M04","M05" "1234","1","0","0","0","0"
the items above are from each field in the table where i look for a specific user and the value of each field. The field M01 reflects a value of 1 in the sample above.
What I am trying to do is read this back into my parent swf to check the value of M01 and if it equals 1 then a button will be active so the user can do the next assignment. If it !=1 then button remains disabled.
I have attempted to load the M01 value into a text field just to see if it is working, but no luck so far as shown below:
My basic loader is:
Code:
Code:
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener (Event.COMPLETE, dataOnLoad);
function onDataLoad (evt:Event)
{
_idTxt.text = evt.target.data['M01'];
}
Any guidance / assistance will be greatly appreciated.
Thanks in advance!