Your <mx ..> tag defining the service:
<mx:HTTPService id="YourJavaService"
url="http://localhost/getData.jsp" result="getDataHandler(event)"
resultFormat="e4x" />
Your call to invoke the service (placed wherever is appropriate in your
mxml code):
YourJavaService.send();
And the event handler:
private function getDataHandler (event:ResultEvent):void { // requires
import mx.rpc.events.ResultEvent;
var myResult:XML = XML(event.result);
for each (var myMessage:XML in myResult.message) {
var zip:Number = Number(myMessage.zip);
...
This works using the following XML structure. You should be able to put
the pieces together from this.
<?xml version="1.0"?>
<response>
<status>1</status>
<message>
<zip>19004</zip>
<lat>40.0137200223673</lat>
<lng>-75.2298750040826</lng>
<cnt>24</cnt>
</message>
</response>
There are lots of examples of handling data and specifically XML data in
the flex tutorials, try these and go from there:
http://learn.adobe.com/wiki/display/Flex/2d.+Tutorial
http://learn.adobe.com/wiki/display/Flex/3a.+Working+with+Data
Stephen
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raja
Sent: Monday, May 04, 2009 5:49 AM
To: Google Maps API For Flash
Subject: Flex and Java integration
Hi every one,
I know how to set the data coming from java into the select boxes or
text boxes.,etc
But if i design a page in flex how to get that data from my java code
into the flex.
How to integrate flex and java..
if any one of you have a sample code then please let me know here or
send to my mail id..
Thanks in Advance
Raja
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---