Tim Walters .NET Blog

Microsoft .NET, along with XML, XSL, XSD, SQL and other cool stuff

Flash Remoting with .NET

Macromedia Flash Remoting MX is a product that allows you to call VB.NET or C#.NET methods directly from within Flash MX.

These methods can return native ActionScript objects which you can then use in Flash MX. As an added advantage the data is sent as binary data instead of verbose XML... I'm a big fan of sending things as XML myself but it does take a bit of work to parse/validate/handle it if you simple want an object with a few properties, or a simple Array.

Macromedia have a nice online book that talks about how to use it, I haven't had a chance to read through it fully myself but it looks good from what I've seen so far.

There's a Development Centre on the Macromedia site that has lots of stuff to look at and play with too, not to be missed if you want to know more!

Lastly I would like to recommend a book which has been given great reviews, Flash.NET.

Comments

Phil Scott said:

Getting .NET and Flash to talk has been something I've been interested in checking out. What kind of cost is there for the Remoting stuff. Macromedia's dynamic pages are not working, which isn't a good sign :)

What I'm looking to do is pretty simply, mostly create some simple shell Flash animations and fill them with content dynamically. Any thoughts?
# February 9, 2003 7:21 AM

Tim Walters said:

Hi Phil,

Flash Remoting MX starts at $US999 depending on the options you select. Not much compared to some of the other costs involved in setting up a good server, but it can be difficult to justify it for smaller projects.

If you're willing to add a little more 'smarts' to your Flash code, you could simply use normal .NET Web Services to achieve the same results (or at least very close).

The XML and XMLSocket objects in Flash enable you to easily talk to .NET by using the XML.load() or XML.sendAndLoad() methods.

There is a slight complication in that Flash doesn't have any support for XPath, so navigating your XML you get back is a little cumbersome... lots of firstChild.firstChild.nextSibling.whereAmIAgain.ohGodImLost.childNodes[10].firstChild.nodeValue :)

I've been working on developing a nice XPath engine for Flash, which I'm modelling off the .NET system... it'll be a while before I can complete it though as it's only done in my spare time... I've got some early work if you're keen to have a play.

Anyway, once you have the XML in Flash you can create/populate your objects and display the dynamic content.

Because Flash MX added support for HTML (only v1.0 tags), direct loading of JPEG/PNG/MP3, it's now much easier to design a dynamic system.

Was there anything else you wanted to know?
# February 10, 2003 3:47 AM

Joao Duarte said:

How can I load dynnamic PNG/MP3? Have your a example?

Thank's
# July 13, 2003 4:54 PM

Carlos said:

I have been trying to get a webservice call to work from flash remoting. I have done everything in the instructions, but it still isn't working correctly. I have also noticed that the sample web service files installed with .net's version of flash remoting do not work. Is there anything I should be doing to get this to work properly?...thanks
# July 31, 2003 2:51 PM

OjHew said:

Whenever i use the sendAndLoad() method flash tells me that there an "error opening URL"
the getUrl() method works fine with the same path but sendAndLoad() returns the error. Any ideas as to why this might be happening?
# November 2, 2003 3:24 AM

Edwin said:

Hello, do you know of any host that offers Flash Remoting with ASP.NET hosting service? I've been looking and still haven't found.
# November 7, 2003 3:27 AM

james said:

hi tim,

i'm trying to do exact as you suggested by using the xml objects in flash to communicate with my backend asp.net server. my question is how do you make asp.net pages to send and receive xml data from the flash movie?

thanks!
# November 14, 2003 3:59 AM

Tim Walters said:

Edwin:
Sorry, no I don't know of any hosts that provide for Flash Remoting, perhaps you could post a query in the Forums at www.flashkit.com

James:
Web Services are the best way, depending how you implement it in Flash you may want to stick with POST, but if you're using Flash MX 2004 then you can use SOAP, post a message in the www.flashkit.com boards and myself or someone else should answer you in more detail if you have further questions.
# November 16, 2003 7:16 PM

Colin said:

www.rjsnetworks.com supports ASP.Net and Flash Remoting. Enjoy!
# December 1, 2003 11:56 AM

TuanVo said:

Can you show me how to load an external image in format *.png please? I've tried, but it just work with *.jpg and *.swf formats.
Thanks.
# December 16, 2003 2:18 AM

Tim Walters said:

TuanVo,

I'm sorry, I was incorrect when I stated that you can dynamically load PNG, there is only support for JPG and SWF files.

A possible solution is to have a small app that 'wraps' PNG files in the SWF format dynamically, I can't remember the names, but http://www.flashkit.com/ should have some links. Ask around in the Forums there.
# December 16, 2003 5:47 PM

MikeW said:

Hey Guys,

Been banging my head on this Flash remoting to .NET stuff for a few days now. I can pull in strings fine from the aspx.cs file. The .NET app is simple a datagrid which works fine. Is DataGlue the only way to handle a remoting call to the .NET app? I try this:
.cs file

datagrid = dataset["Customers"];
Flash.DataSource = dataset["Customers"];
Flash.DataBind();

in actionscript
...
function getResults{
{
flashservice.mypage();
}
function getResults(result)
{
datagrid.dataProvider(result);
}

can anyone help me out? I'm looking for the simplest example of binding a flash datagrid/listbox anything really... Im using SQL 2000 / ASP.NET

Cheers guys :)
M
# December 30, 2003 11:03 PM

Dr. Shim said:

I can't even load the !@#$% SWF into my ASPX page.

I want my mommy.
# January 29, 2004 4:23 PM

ReShaw said:

Who can help me??~
Who have the skill for building XMLsocket with c#?call me! your friends!
E-mail:xl722@sohu.com
# January 30, 2004 2:09 AM

ReShaw said:

I must post again!
Who can help me??~
Who have the skill for building XMLsocket with c#?call me! your friends!
E-mail:xl722@sohu.com
# January 30, 2004 2:20 AM

Joe Orbman said:

For a better .Net to Flash experience, check out FlashORB.Net at http://www.flashorb.com FlashORB.Net is the only alternative to the Macromedia's .Net solution. I believe it is a significant step forward from the Macromedia's way of doing Flash Remoting in .NET. We support all kinds of data types on the server side: primitives, arrays, collections, complex types, named classes, ADO DataSet, remote references. The best part is that there's no need for silly ASObject anymore - FlashORB.Net automatically converts to the appropriate server-side types.
# February 17, 2004 1:55 PM

c# tutorials said:

http://www.dotnetwatch.com has some good examples please check

# February 12, 2008 4:16 PM

Prashant said:

Hey friends, I've tried and successfully implemented facade architecture working usign Flash remoting and ASP.NET. anybody can contact me at prashant@diligentinfosys.com, I'm trying to upload a tutorial on codeproject to help everyone

# April 2, 2008 9:47 AM

deepak karma said:

Hello sir my emailid is deepak.karma@mathimitation.com.

i have mate a project contating flash remoting with asp.nt .It works locally but when i run it on server by publishing by IIS it does'nt work. pls help me  if u have any solution.i can send a sample project (if required).

Thanks in advance.

# December 9, 2008 5:34 AM

Amf4Asmx said:

I've noticed a lot of people have issues with the existing solutions for Flash Remoting and ASP.Net.  For those of you using ASP.Net 2.0 or higher, there's a new solution: Amf4Asmx.  Simply build out a WebService, add the Amf4Asmx binaries, and add about half a dozen lines to your web config.  Your web service's asmx file automatically acts as the flash remoting gateway!

I sincerely hope that this helps out a lot of you out there.

# April 8, 2009 10:48 PM

bahar_radfar said:

i am not english so sorry if i dont write in english well. i must send some variable from a flash form to an aspx page ,for the first time i can do it but if i want to repeat it again i got "Erorr open url ..."

my asp.net project is file system does this case cause this problem?

please help me

e-mai:rad.bahar@yahoo.com

# September 2, 2009 10:32 AM

Cheap Burberry Hats NO-008 said:

the Cheap Burberry Hats NO-008 for men.

# November 9, 2011 10:11 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)