File: remoteobject_test.as

package info (click to toggle)
pyamf 0.6.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,692 kB
  • sloc: python: 17,944; xml: 455; makefile: 116; sql: 38; java: 11; sh: 7
file content (21 lines) | stat: -rw-r--r-- 721 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Create the AMF Channel
var channel:AMFChannel = new AMFChannel( "pyamf-channel", "http://localhost:8080/services" );

// Create a channel set and add your channel(s) to it
var channels:ChannelSet = new ChannelSet();
channels.addChannel( channel );

// Create a new remote object and add listener(s)
var remoteObject:RemoteObject = new RemoteObject( "EchoService" ); // this is the service id
remoteObject.channelSet = channels;
remoteObject.echo.addEventListener( ResultEvent.RESULT, onEchoComplete );

// Make a call to the remote object
remoteObject.echo( "Hello World" );


// Here is the result event listener
private function onEchoComplete( event:ResultEvent ):void 
{
  Alert.show( event.result.toString() );
}