hide side navigation
    5 most recent
    Web Services
    Library's
    Component's
    Applications
    Articles
  Flash streaming servers  Flash button as Flex icon  Flex form by email  Hello Remoting with AS3  AS3 Saving data from Flash  AS3 Loading data into Flash  Fire Effect  Contact form  Dragable buttons  Hello World with openamf  Loading helper classes  Upload with Flash 8  Transitions effects  Snapshot with Flash 8  Hello World Remoting AS2  Flash AS2 Remoting Connector  Saving data from Flash  Loading data into Flash  FlashCom & Remoting login  Cell Renderer API  Editing a table using remoting components  Flash MX2004 web service classes  Browsing a catalog  amfphp Documentation  Hello World Remoting  Online Store with AMFPHP  Flash clients for Web Services  Web Service Walk Though with NuSoap  Popup windows in flash with javascript  Installing Apache/PHP  MoreOver News Feeds  Load Edit Save Text Files via CGI  Save Movie Clip Postion via PHP and MySQL
Current Page (1) Next Page >>  View Article Example >> 1 | 2 | 3 | 4


Provider usage

 
import com
.flashdb.provider
var = new provider()
function 
handleResult(res){
  
trace(unescape(res))
}
//whithout fourth parameter, is just a load
p.loadData("some.txt"this"handleData"false)
//whith fourth parameter, is a sendAndLoad
p.loadData("some.php"this"handleData", {nr:1name:"jorge"})

  

Both calls use the same function as callback. The first don't pass any arguments, while the second pass an object that will be copied to the LoadVars object and passed to the back end script. Arguments of the loadData method are:

Webservice Provider usage

 
import com
.flashdb.webserviceProvider;
function 
handleResult(res) {
    
lista.text ""
    
for (var i=0i<res.lengthi++) {
        
lista.text += res[i].name;
    }
    
summary.text res.length+" services, consult http://www.xmethods.net"
}
service = new webserviceProvider("http://www.xmethods.net/interfaces/query.wsdl");
load_btn.onPress = function() {
    
lista.text "Loading ..."
    
service.callMethod("getAllServiceNames"this._parent"handleResult"""false);
};

  

Here we construct a web service and call without parameters (that's because the empty string as third and false as forth parameter) We set the callback as the handleResult function, where we should parse the result, that means, we should know the result structure. Parameters are:

Remoting Provider usage

 
import com
.flashdb.remotingProvider
//Instance of remoting service
myProvider = new remotingProvider("gateway.php""HelloWorld")
//callback function
function onEchoData(msg){
    
showRes.text msg
}
//Buttons handlers
callButton.onPress = function(){
    
myProvider.callMethod("makeEcho"this._parent"onEchoData", {msg:"Hello from remotingPovider class"}, false)
}
clearButton.onPress = function(){
    
showRes.text "";
};

  

Here we construct a remoting provider and call passing a string parameters. note that even when using simple parameters, we packet in an object and pass a false as the flag, so the class knows that it should pass object parameters as simple arguments to the service. We set the callback as the handleResult function, where we should parse the result, that means, we should know the result structure. Parameters are:

Since classes are short, let's take a look at it.

Current Page (1) Next Page >> 1 | 2 | 3 | 4