AS3 Lightweight Remoting Framework

This project is motivated by the need for a simple yet robust framework for handling remoting calls. This framework could be used in AS3-only projects without the Flex framework, or it could be used in a Flex project to access remoting resources that aren't supported by the Flex framework.

You can also access this project from thethe RIAForge project page. There you can use the forums and post defects. http://as3lrf.riaforge.org.

Download

You can download the latest SWC and source from the following SVN repository: http://svn1.cvsdude.com/osflash/as3lrf

Sample Usage

package {
	
	import com.dannypatterson.remoting.FaultEvent;
	import com.dannypatterson.remoting.ResultEvent;
	import com.dannypatterson.remoting.ServiceProxy;
	import flash.display.Sprite;
	
	public class RemotingExample extends Sprite {
		
		private var serviceProxy:ServiceProxy;
		
		public function RemotingExample() {
			serviceProxy = new ServiceProxy("http://www.dannypatterson.com/flashservices/gateway", "com.dannypatterson.blog.Blog");
			serviceProxy.addEventListener(ResultEvent.RESULT, onResult, false, 0, true);
			serviceProxy.addEventListener(FaultEvent.FAULT, onFault, false, 0, true);
			serviceProxy.addEventListener(FaultEvent.CONNECTION_ERROR, onConnectionError, false, 0, true);
			serviceProxy.getEntries(0, new Date(2006, 5));
			serviceProxy.getEntries(0, new Date(2006, 6));
		}
		
		private function onConnectionError(event:FaultEvent):void {
			trace("onConnectionError: " + event.fault);
		}
		
		private function onFault(event:FaultEvent):void {
			trace("onFault: " + event.fault);
		}
		
		private function onResult(event:ResultEvent):void {
			trace("onResult: " + event.result);
		}
		
	}
	
}

Forums

Bug Tracking

Credits

Discussion

Gabriel, 2011/06/29 11:19
This is great! very light!

Finally, it's important to register the classes using in your application, otherwise you receive an Object:

registerClassAlias(aliasName:String, classObject:Class)

Example:
registerClassAlias("com.example.eg", ExampleClass);

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#registerClassAlias%28%29

this replace flex [RemoteClass]
Enter your comment
 
 
as3lrf.txt · Last modified: 2006/10/19 09:42 (external edit)
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki