Flex is not directly accessible to the database, so it can be used as a service to call the data, Httpservice, webservices is more commonly used two methods, because the contact WebService more so give its calling method.
import Mx.controls.alert;import Mx.events.flexevent;import Mx.rpc.events.ResultEvent; Import mx.rpc.events.FaultEvent; Import mx.rpc.soap.LoadEvent; Import Mx.rpc.soap.WebService; Import Mx.controls.Alert; private var str:string = "http://localhost/RaySky/Dvag.asmx?wsdl"; private Var Webservice:webservice; Private Function OnClick (): void {//Create and instantiate the WebService sample, but first import webService class WebService = new WebService (); webservice.wsdl = str; WEBSERVICE.LOADWSDL (str); Event Listener Webservice.addeventlistener (Loadevent.load, onLoad); Webservice.addeventlistener (Resultevent.result, Onresult); Webservice.addeventlistener (Faultevent.fault, Onfault); } Private Function OnLoad (e:loadevent): void {//For related actions} Private function Onresult (e:resultevent): void {} private Fu Nction Onfault (e:faultevent): void {trace (e.message); Give warning, lazy reluctant to debug the time so come Mx.controls.Alert.show ("Failed to connect to WebService, please check the network!") "," error "); }