New Tutorial - Introduction to Flash Remoting with Fluorine

I’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.

Introduction to Flash Remoting with Fluorine

28 Responses to “New Tutorial - Introduction to Flash Remoting with Fluorine”

  1. Marcus Baffa Says:

    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,

  2. Philippe Says:

    Nice introduction.

    I’m starting to consider this solution for a future project.

  3. Colin L Says:

    Hi Dan,

    Tutorial looks good.

    Thanks for all the help mate.

  4. DannyT Says:

    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 :)

  5. AndyB Says:

    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 :D

    Otherwise sweet tut, got mine working after i figured that out with netconnection.debug window :D

  6. DannyT Says:

    Thanks Andy, fixed now.

  7. Mike Says:

    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?

  8. DannyT Says:

    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

  9. Flávio Banyai Says:

    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

  10. EReedstrom Says:

    I’ve been trying to migrate the source over to VWD 2005 Express but with no luck. Any help would be appreciated.

  11. EReedstrom Says:

    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.

  12. DannyT Says:

    I would suggest getting the opinions of those on the fluorine mailing list, I’m sure many will have some good ideas.

  13. Marco Says:

    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 !!!!!!

  14. DannyT Says:

    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

  15. Marco Says:

    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 :D,i am going to wait until you answer again.

    Thanks in advanced

  16. Cyrille37 Says:

    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.

  17. DannyT Says:

    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.

  18. MikeG Says:

    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

  19. sajid Says:

    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 :)

  20. cw Says:

    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’);
    }

  21. DannyT Says:

    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.

  22. Steve Says:

    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?

  23. Nick Says:

    New?

  24. DannyT Says:

    Okay so it was new when I write it

  25. Alex Says:

    I am also looking for a flourine/Flex 2 solution. I guess i will check back to see if you have any updates

  26. Sushant Says:

    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

  27. Basu Says:

    Hi Danny,
    Your samples helped me in solving lot of problems which i am facing in remoting.. thanks a lot :o)

    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

  28. telewizja n Says:

    great tutorial

Leave a Reply