Here is how to use a webservice SOAP push in flash 9 enjoy
Action script
import mx.services.WebService;
import mx.services.PendingCall;
/*
for testing puposes outside of a webserving ENV, use the following security parameter
*/
System.security.allowDomain("http://yourdomainhere");
var toNumberDial:String = "";
var ServiceResponse:String = "Ready Response";
/*
for final production server, set the above to the production path and uncomment the below and be sure to place the
path to the cross domain policy xml
*/
//System.security.loadPolicyFile("http://path-to/crossdomain.xml");
/*this set up is using the rare method but very effective webservice class of flash
the set up is very simple, at it inheirits netconnection and xml class for the soap exchange by default
/*
In this example the webservice gateway is established with two lines of code
*/
var sWSDURL:String = "http://yourwebservicehere";
var WebServiceGateway:WebService = new WebService(sWSDURL);
/*
A function is placed to send the values inputed in by user to establish the call;
/*
as a means of reporting the results, we assign the value of the response node to the DynamicText box variable
**this is also a means of telling the flash code with a swith modifier to play the action sequence when it is a success
*/
pcResponse.onResult = function(nResponse):Void {
_root.ServiceResponse = nResponse;
trace(nResponse);
};
}
No comments:
Post a Comment