New Tutorial – Introduction to Flash Remoting with Fluorine
Published on July 7th, 2006 by DannyT. Filed under Flash, TutorialsI’ve just written up my first tutorial on using Fluorine, the open source Flash remoting solution for the .net platform. Have a read and leave any feedback in the comments here.

Marcus Baffa
July 7th, 2006 at 5:32 am
Hi Danny,
Congratulations for this Introduction. I intend to use fluorine in my next Flex 2.0 project.
It would be very usefull if we could have access to an introduction of using fluorine and Flex 2.0.
If you know any sample about this please let know
Regards,
Philippe
July 7th, 2006 at 2:10 pm
Nice introduction.
I’m starting to consider this solution for a future project.
Colin L
July 7th, 2006 at 3:41 pm
Hi Dan,
Tutorial looks good.
Thanks for all the help mate.
DannyT
July 8th, 2006 at 1:51 am
Marcus: I intend to have an attempt at Flex2 with Fluorine in the near future, just need to sort out a new machine that can handle flex builder.
Thanks for the feedback guys
AndyB
July 14th, 2006 at 3:15 am
Hey Dan,
Just went through the tutorial, found an error in the flash actionscript file:
var pc:PendingCall = _service.say(“Hello World!”);
according to the HelloWorld Class this line should read:
var pc:PendingCall = _service.serverFunction(“Hello World!”);
or the name of the method in the HelloWorld class could be changed of course
Otherwise sweet tut, got mine working after i figured that out with netconnection.debug window
DannyT
July 14th, 2006 at 6:53 pm
Thanks Andy, fixed now.
Mike
July 15th, 2006 at 8:06 pm
Hi nice intro, just wondering as im new to all this whether it is possible to call flash functions from asp .net? so doing this the other way around?
DannyT
August 4th, 2006 at 6:34 pm
Mike, I’m not sure in what instance you would wish to do so. As flash is a presentation technology where all user interactions would be handled, any server side logic would be triggered by a call from flash and once executed a response returned.
Calling Flash from .net would imply you have some form of non-flash interaction or event raised client side, if using .net webform controls to communicate with the flash movie you could look at flash to javascript communication. Or if you’re thinking of a form of multi-user application where push/pull comms need to be considered you could look at Flash Media Server or RED5
Flávio Banyai
August 18th, 2006 at 3:56 pm
Great tutorial! Followed it step by step into a ASP.NET 2.0 project and it had worked perfectly!
The only thing I had to do before getting it to work was migrating the downloaded sources of Fluorine to the Visual Web Developer 2005 Express Edition (pretty easy step).
Thanks!
Tuco
EReedstrom
September 14th, 2006 at 5:10 pm
I’ve been trying to migrate the source over to VWD 2005 Express but with no luck. Any help would be appreciated.
EReedstrom
September 14th, 2006 at 11:14 pm
Fixed it… had to compile in the Porjects folder and not on a network path.
By the way, I am trying to access functions directly from the partial class. Fluorine gives an example, but I can not get it to work. My main task is to use flash to update controls on the aspx form through Atlas. But if I use a class, then the class has no way to figure out where the controls are.
When using classes in the past, I have passed “this” to the class and set it as the parent. Obviously this doesn’t work when instantiating from the flash movie. Work arounds are appreciated.
DannyT
September 17th, 2006 at 4:31 pm
I would suggest getting the opinions of those on the fluorine mailing list, I’m sure many will have some good ideas.
Marco
September 18th, 2006 at 3:43 pm
where is this file com.TheSilentGroup.Fluorine.dll I have this one in the files I download from fluorine com.TheSilentGroup.Fluorine.csproj is the same one ? please someone help me ! I am trying to implement a search in a website and I am new in asp and the client has a windows server :S and now I need to make the service in asp a friend of mine is helping me but he does´t know anything abput flash I wanna configurate everything and for some reason I CAN´T FIND THAT FILE !!!!!!
DannyT
September 18th, 2006 at 5:21 pm
Marco,
you need to compile the application using Visual Studio or Visual Web Developer or another .net compiler. Ask your friend to open the .csproj file and send you the .dll
Marco
September 18th, 2006 at 5:47 pm
Danny thank you man ! I already compile the file with visual studio c# 2005 I am trying to do myself ,please can you tell me the what testfluorine extension is ? c#? or aspx? ,and again thank you so much to answer so quickly
,i am going to wait until you answer again.
Thanks in advanced
Cyrille37
September 19th, 2006 at 8:30 am
Hello guys,
We can make C# and Flash speaking together with two technology :
One is ASP/Fluorine/Flash and the other is ASP/WebService/Flash and I would like to know your opinion.
After few tests, I think Fluorine under ASP is very nice but seems to need more code to write than WebService needs. With Webservice the Flash integration is very simple.
Please, could you give us your opinion about those technologies ?
That will clarify my mind.
Regards, Cyrille.
DannyT
September 19th, 2006 at 10:05 am
Marco,
The fluorine gateway you need to point at is gateway.aspx, i’m not sure what you mean by testfluorine extension. Have you tried stepping through the tutorial? Hopefully that will help you get an understanding of how remoting helps you send objects to/from asp.
Cyrille,
Webservices are also an option and can be very useful and easy to setup. However, most flash developers I am aware of and respect prefer remoting for a number of reasons. One of these reasons is that remoting is faster as it uses a binary formatter eliminating the need to serialize and translate the SOAP xml. Other advantages include security (.net remoting can take advantage of all of IIS security measures), state management (web services need to start from every call, remoting can manage state saving).
I’m sure there are other points to consider also, so would suggest further research. I would however firmly reccommend remoting over web services for all but the simplest of requirements.
MikeG
September 21st, 2006 at 10:12 pm
Danny, thanks for the tutorial. Flourine samples are pretty hard to come by.
I modified your tutorial to use the stub code from the ServiceBrowser, but I couldn’t quite get it to work. The function returned undefined. Have you been able to get it working using the stub code?
Thanks!
Mike
sajid
October 14th, 2006 at 9:53 am
Hi….
dear I have seen some ur posts regarding .net and Flex2 , have u found some solutions abt it.. could show some example of .net and Flex 2
Thanks
cw
November 3rd, 2006 at 10:55 pm
Hi all
I’m new to .NET/C# and Flash
I have a project that I’m finishing that uses actionscript v1
There is a whole lot of it…
Given that I don’t want to convert the whole project to actionscript v2, how can I do the florine remoting in actionscript v1?
Is there anyone who can tell me how to do the flash code in actionscript v1?
Below is the AS v2 code…
Many thanks in advance!
import mx.remoting.*;
import mx.rpc.*;
import mx.remoting.debug.NetDebug;
NetDebug.initialize();
var _service:Service = new Service(“http://localhost/FluorineTest/Gateway.aspx”, null, ‘FluorineTest.HelloWorld’, null , null);
var pc:PendingCall = _service.serverFunction(“Hello World!”);
pc.responder = new RelayResponder(this, “handleResult”, “handleError”);
function handleResult(re:ResultEvent)
{
trace(‘The result is: ‘ + re.result);
}
function handleError(fe:FaultEvent)
{
trace(‘There has been an error’);
}
DannyT
November 4th, 2006 at 8:04 pm
CW, as2 is compiled down to as1, you might want to take a look at buraks Actionscript Viewer which lets you decompile swfs into as1 or as2. Otherwise try the fluorine mailling list.
Sorry I can’t be more help at the moment, have a log going on at work and not much time spare.
Steve
December 23rd, 2006 at 4:08 pm
Greets…As I step thru the VS side of things I can run the project….no errors and brings up a blank page. As I strup thru the Flash side of things I hit the handleError branch. Any thoughts on pinpointing where the problem is?
Nick
February 16th, 2007 at 3:57 pm
New?
DannyT
February 16th, 2007 at 5:39 pm
Okay so it was new when I write it
Alex
February 20th, 2007 at 11:41 pm
I am also looking for a flourine/Flex 2 solution. I guess i will check back to see if you have any updates
Sushant
March 27th, 2007 at 3:06 pm
Dear Danny,
Your tutorial is simply great. Also Fluorine documentation helped a great deal after your tutorial got working. Just need to mention that I was confused how to cmopile to .NET version 2 assembly. But later I compiled at command line and got it working right away. Thanks really!!! I am looking forward to read all your posts and tuts if any and forthcoming.
Thanks once again.
Sushant Yalgudkar
Basu
May 18th, 2007 at 5:42 am
Hi Danny,
)
Your samples helped me in solving lot of problems which i am facing in remoting.. thanks a lot
i have a question ….can u please tell me what is the importance of bringing remote class and remotedebud class components on to the Stage??
Thanks,
Basu
telewizja n
November 10th, 2007 at 12:01 pm
great tutorial
appleo
July 31st, 2008 at 7:14 pm
Thanks for posting this easy to follow tutorial. Now if only I can get it to work… I’m using Flash MX 2004, Visual Studio 2005 and the FluorineFX from http://www.fluorinefx.com (the fluorine.thesilentgroup.com address in your tutorial forwards here). I installed both the MX 2004 for ActionScript 1 and for ActionScript 2 modules.
I got past a couple of errors on my own which I will describe, but have hit a third error that I can’t seem to figure out.
I tried the tutorial a couple of ways. The first time in VS2005 I created the c# web app (which I named “FluorineTest1″) using Fluorine’s “FluorineFx ASP.NET Web Site” template (their site calls it the wizard) which creates the web.config, Gateway.aspx, etc, for you. The “httpModules” section in web.config is different from the tutorial however, the module is:
not
Since the app isn’t at TheSilentGroup.com anymore, I figured the wizard version is correct. Anyway if I use the version from the tutorial I get an error: Error opening URL “http://localhost/FluorineTest2/Gateway.aspx”
The second time I tried just creating a regular ASP.NET Web Site app and manually adding the web.config section and Gateway.aspx, like in the tutorial.
ERROR #1
However when I tried running the Flash movie in MX2004 I got an error “Unrecognized attribute ‘requirePermission’”. It turned out the “FluorineTest1″ web site was set to .net 1.1 in IIS (a problem with their template?), so I changed it to 2.0 (in IIS open the properties for the virtual directory, goto the ASP.NET tab, and change ASP.NET version dropdown to 2.0) and the error went away.
ERROR #2
However now Flash was displaying an error “It is an error to use a section registered as allowDefinition=’MachineToApplication’”. It turned out the “FluorineTest1″ was not set up as an application in IIS. In the virtual directory’s properties, Directory tab, under Application Settings, next to “Application name” there is a [Create] button you click and it turns it into an application. The error then went away.
ERROR #3
But now when I run the Flash, I am seeing the message “There has been an error”. To get some more info I changed handleError to print the message:
function handleError(fe:FaultEvent)
{
trace(‘There has been an error: ‘ + fe.fault.faultstring);
}
which is
There has been an error: Failed to locate the requested type FluorineTest.HelloWorld
Can anyone see what I might be doing wrong?
Much appreciated!
appleo
July 31st, 2008 at 7:55 pm
My above post isn’t displaying correctly (it had some HTML characters in it which didn’t get escaped) so here it is again in HTML format…
Thanks for posting this easy to follow tutorial. Now if only I can get it to work…
I’m using
Flash MX 2004
Visual Studio 2005
FluorineFX from fluorinefx.com (the fluorine.thesilentgroup.com address in your tutorial forwards here).
I installed both the MX 2004 for ActionScript 1 and for ActionScript 2 modules.
I tried the tutorial a couple of ways.
The first time in VS2005 I created the c# web app (which I named "FluorineTest1")
using Fluorine’s "FluorineFx ASP.NET Web Site" template
(their site calls it the wizard) which creates the web.config, Gateway.aspx, etc, for you.
The "httpModules" section in web.config is different from the tutorial however, the module is:
<add name="FluorineGateway" type="FluorineFx.FluorineGateway, FluorineFx"/>
not
<add name="FluorineGateway" type="com.TheSilentGroup.Fluorine.FluorineGateway,com.TheSilentGroup.Fluorine" />
Since the app isn’t at TheSilentGroup.com anymore, I figured the wizard version is newer/correct.
Anyway if I use the version from the tutorial I get an error:
Error opening URL "http://localhost/FluorineTest2/Gateway.aspx"
The second time I tried just creating a regular ASP.NET Web Site (named "FluorineTest2")
and manually adding the web.config section and Gateway.aspx, like in the tutorial.
I got past a couple of errors on my own which I will describe, but have hit a third error that I can’t seem to figure out.
ERROR #1:
When I tried running the Flash movie in MX2004 I got an error
"Unrecognized attribute ‘requirePermission’".
It turned out the "FluorineTest1" web site was set to .net 1.1 in IIS
(I didn’t see this error when I created a regular site w/o the template – a problem with their template?)
so I changed it to 2.0 and the error went away.
To do this:
open IIS
open the properties for the virtual directory
goto the ASP.NET tab
change ASP.NET version dropdown to 2.0
ERROR #2:
However now Flash was displaying an error:
"It is an error to use a section registered as allowDefinition=’MachineToApplication’".
It turned out the "FluorineTest1" was not set up as an application in IIS.
I changed it to an application and the error went away.
To do this:
open IIS
Right click on the virtual directory & click Properties
goto the Directory tab
under Application Settings, next to "Application name", click the [Create] button
(if it says [Remove] then the virual directory is already an application)
ERROR #3:
But now when I ran the Flash movie, I saw the message "There has been an error".
To get some more info I changed handleError to print the message:
function handleError(fe:FaultEvent)
{
trace(‘ERROR: ‘ + fe.fault.faultstring);
}
which returns
ERROR: Failed to locate the requested type FluorineTest.HelloWorld
Can anyone see what I might be doing wrong?
Much appreciated!