views:

931

answers:

3

We have found the combination of ASP.Net as a server backend and Adobe Flash for the User Interface to be an excellent marriage.

Up until now we have used Javascript as the communication conduit between the two technologies. This has worked well, however we want to be able to pass objects back and forth rather than just string variables and we also want better performance.

There are a number of methods you can use to communicate:

  • Javascript
  • Web Services (supported properly in MX, not in CS3, not sure about CS4)
  • Flash Remoting
  • others?

My research has indicated that Flash Remoting is the best performer.

On the server you need to provide a remoting gateway (Flash Remoting ($999 USD), FluorineFx, WebORB, AMF.Net).

What is the best way to use remoting from the client?

The problem lies in that the Flash remoting libraries don't seem to be very good or well supported. They were in MX, not in CS3, not sure about CS4 yet.

Flex apparently has excellent remoting support, however we love the ability to make a freeform UI in flash and not be restricted to Flex Controls. I have seen suggestions of embedding flash swf's in flex - but am reluctant to introduce another layer. I have not used Flex extensively so I may be missing something here.

Has anyone had any experience in this area? Should I try and embed my swf in flex? Or does CS4 provide good enough remoting support?

Thanks.

Bobby - That's a good idea. JSON might do the trick.

Brd6644 - We are already using fluorine on the server. The problem lies in using Flash (NOT Flex) on the client (see above), and Flash's lack of good support for remoting.

A: 

Have you tried building a Web Service serving up JSON? I would try that and see how it suits your needs before going the Flash Remoting route.

BobbyShaftoe
+1  A: 

Hi,

Not sure what you mean about good support. We also faced this problem and are using Fluorine. I built a set of classes based around the NetConnection object. Everything works well and we have the VO/DTO objects translating correctly and being correctly typed in Flash. The only problem i've encountered is the fault object being typed as Object and apparently having no useful documentation. Another thing we have an issue with is right now we have to manually transcode the VO/DTO objects, rather than auto generating the C# and AS3 code from the same definition files.

We've used this on two projects now and it has worked with no hiccups.

Jotham
+1  A: 

We have done several projects in Flash with either Fluorine or WebORB remote gateway. We had some problems (I think for instance there were problems using ObjectEncoding.AMF3) but to me it's the best solution. We also used JSON which is also a good choice, but not as good as WebORB or FluorineFX (to me).

Maybe have a look at WebORB examples. I think there are some examples written in Flash instead of Flex.

private var service:NetConnection;
service=new NetConnection();
service.objectEncoding=ObjectEncoding.AMF0;
service.connect("GatewayUrl");
responder=new Responder(callResult, callFault);
service.call("name_service", responder, parameters);

That's basically all you need to do (beside registering your classes with registerClassAlias).

Off course, Flex is better supported for remoting.

Check this link on my blog for another example.

Lieven Cardoen