blog.ashier.com flash / flex / air development
rss rss comment

Archive for the ‘Weborb’ Category

There are alot of ways to connect to a remote service in Flex / Flash.

You can do it tag based:

Actionscript:
  1. <mx:Application
  2.     xmlns:mx="http://www.adobe.com/2006/mxml"
  3.     layout="absolute">
  4.    
  5.     <mx:RemoteObject id="blazeService" fault="onFault(event)" source="hello.Hello" endpoint="http://localhost:8400/hello/messagebroker/amf/" destination="Hello">
  6.         <mx:method name="sayHello" result="onResult(event)" />
  7.     </mx:RemoteObject>
  8.  
  9.     <mx:Script>
  10.    
  11.         <![CDATA[
  12.             import mx.messaging.channels.AMFChannel;
  13.             import mx.rpc.events.ResultEvent;
  14.             import mx.rpc.events.FaultEvent;
  15.            
  16.             private function onResult(e:ResultEvent):void {
  17.                 trace("Result" + e.result);
  18.             }
  19.            
  20.             private function onFault(e:FaultEvent):void {
  21.                 trace("fault");
  22.             }
  23.         ]]>
  24.     </mx:Script>
  25.    
  26. </mx:Application>

or actionsript based:
Read the rest of this entry...

Tags: , , , , ,