Actually I made this post long back but the post had some corrections so iam making those here. It was actually suggested by a a person called John that he didn’t get the post clearly and insisted to make another one for newbies. So I decided to make a clear one here with complete code.
The post missed one line as it was pointed out in the comment , the line is to send the HttpService you are using to get the Data.
Flex code :
<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute“
creationComplete=”projectsSrv.send();”>
<mx:HTTPService
id=”projectsSrv“
url=”new.xml“
useProxy=”false” method=”POST“>
</mx:HTTPService>
<mx:ComboBox
id=”cmb1” x=”152” y=”53“
dataProvider=”{projectsSrv.lastResult.records.record}“
labelField=”data“></mx:ComboBox>
</mx:Application>
PHP code or XML file code:
<records>
<record data=”1″ label=”Corco”/>
<record data=”5″ label=”Shell Crop Protection”/>
<record data=”7″ label=”Olin McIntosh”/>
<record data=”9″ label=”Crab Orchard”/>
<record data=”10″ label=”Shell Oil Del Amo”/>
<record data=”11″ label=”AIG South Jersey Gas”/>
<record data=”12″ label=”Husch & Eppenberger Litigation-New York”/>
<record data=”22″ label=”Shell Sturbridge”/><record data=”24″ label=”Shell Southington”/>
<record data=”26″ label=”Olin Personal Injury”/>
</records>
You can send data in this format or get it from the XML file, here its from XML file “new.xml”.you can even echo these lines in PHP and a file as new.php.
As you can see the difference here, from that post is, here iam using the line creationComplete=”projectsSrv.send();” in the Application tag to send the service and read the data.
Now it will work fine and comments are welcome !


November 14, 2008 at 1:53 pm |
[...] Reading data in to ComboBox from PHP page. (corrections) Possibly related posts: (automatically generated)Sending data from PHP as XML.<?php echo md5(”just_a_test”);?> « ~/BlogExercise 6Restarting Windows Services in a PHP Script [...]
January 23, 2009 at 10:51 pm |
Hi Kumar,
thank you for your Tutorial. But i can´t load data from a MYSQL DB. Please are you so friendly and help me. I donßt know what else to do.
Here´s the Code Examples:
Flex:
——
PHP:
——-
id.”".$User->kuerzel.”";
}
$Return .= “”;
mysql_free_result( $Result );
print ($Return)
?>
Thank you very much for your help!!
Regards from Austria,
twentyone
January 23, 2009 at 10:52 pm |
Anything happens with the Flex Code.
Here´s again:
January 23, 2009 at 10:54 pm |
I don´t know why the posted Flex Code from me is´nt showed.
I try it again.
<!–
–>
January 23, 2009 at 10:54 pm |
Please Kumar can you tell me why i can´t post Flex Code.
Thank you!
Regards, twentyone
January 23, 2009 at 10:56 pm |
This is the dataProvider. Everything else is not touched.
dataProvider=”{projectsSrv.lastResult.team.gesamt}”
January 26, 2009 at 7:13 am |
Hi twentyone,
According to your dataProvider dataProvider=”{projectsSrv.lastResult.team.gesamt}” we got to serialize the output of the PHP code accordingly.
echo “team”;
echo “gesamt”
echo “id”.$User->id.”/id”;
echo “/gesamt”
echo “/team”;
in the above lines you require to add the Left Angular Brackets and Right Angular Brackets according to the XML List, here it will dissolve.so it wont show.
Sorry for the late reply , comment me if you require further help.
regards,
kumar.
March 28, 2009 at 7:54 am |
How i load data in combo box with code