tags:

views:

680

answers:

8

Can a flash front end talk to a .net backend?

+4  A: 

Yes.

We use Adobe Flex to talk to .Net XML web services.

Be careful with complex serialised .Net types (for instance DataSets) - ActionScript can't handle them.

Instead produce simple XML with primitive types.

See also: http://stackoverflow.com/questions/44817

<mx:WebService id="myDataService" showBusyCursor="true">
    <mx:operation name="WebMethodName" resultFormat="object" result="functionFiredOnComplete();"></mx:operation>
</mx:WebService>

public function load():void
{
    myDataService.loadWSDL( "web method's wsdl" );
    myDataService.WebMethodName.send( params );
}

public function functionFiredOnComplete():void
{     
    // get data
    var myData:Object = myDataService.WebMethodName.lastResult;
    ...
Keith
+1  A: 

Yes

Best keywords to search for are Flash .net and Flex

In the old days there was another tool but with Flex its all been simplified.

mugafuga
+2  A: 

Flash can also talk to the hosting page via JavaScript.

bryanbcook
you can, but you don't need to
Iain
+1! Hardly the point, @Iain. If you want your code to "degrade gracefully" (e.g., the client doesn't have Flash and you want to use the same code), this is a cool option. And one I didn't think of. Plus he said "also" which gives you a free pass to start mentioning unnecessary things :)
Yar
+2  A: 

yes, through web services. Check this out

craigmoliver
+1  A: 

If you are de/serializing a lot of objects (which Flash/Flex isn't particularly fast at), or more complex types, then you might want to take a look at WebOrb. It's a free object broker, which might sound scary, but it basically handles translation between the native object types of the two technologies. It pretty much "just works", and can increase performance quite significantly in some situations.

It also comes with a code generation tool if all you want is CRUD and stored procedure access for a SQL database, which is quite nice.

Steven Robbins
Interesting. What are you basing Flash/Flex not being particularly fast at serializing objects? In my tests, ANYTHING it does in pure code (i.e., no screen interaction) is very fast.
Yar
+2  A: 

you could also try AMF.NET, a .NET implementation of Flash Remoting using ActionScript Messaging Format (AMF)

http://amfnet.openmymind.net/overview/default.aspx

brillyfresh
Neat. Is that faster, more compact, what, compared to SOAP?
Yar
+1  A: 

I would recomend FluorineFX we use that at work and its great. The only downside is that we end up with a lot of value objects that are only used to transfer data between .net and flex. And the fact that the standard C# naming style and the flex naming style has some minor differences makes value objects a bit ugly in either flex or .net.

Tjelle
A: 

My older brother and I developed several methods for Flash/.Net communication. I've seen web services mentioned above (which is a great way of doing it), but we also used simple .aspx pages and had stuff passed via querystring (poor man's way of doing things), using Flashvars to get data TO Flash, but my favorite - Using .Net and a repeater control to build xml files which were then consumed by Flash. We created some pretty cool stuff doing that!

Darth Perfidious