ActionScript 2.0 Flash Remoting with Flash CS3

I installed my shiny new copy of Flash CS3 today and (after playing around with the new features) immediately was greeted with errors when compiling the Remoting project I’m working on.

The fix is to copy the needed packages from your Flash 8 install to a Classpath that Flash CS3 is looking for (best to make a new one rather than dump them with the CS3 classes). The old ones live in Macromedia Flash 8 -> First Run -> Classes -> mx and the packages you need are data, remoting, rpc, and services or you can download this zip file.

Remoting always seems to be the bastard step-child that is last to be updated or documented, with Flash 8 it was a couple of months before Macromedia decided to release the remoting components. Of course with AS3 you don’t need these packages as you use NetConnection instead like this or this.

14 Comments

  1. Josh
    Posted April 21, 2007 at 10:49 am | Permalink

    Isn’t it all kind of pointless w/o the NetConnection Debugger? It’s back to the dark ages w/ CS3.

  2. KreeK
    Posted April 21, 2007 at 4:00 pm | Permalink

    The NetConnection debugger was always buggy for me so I don’t miss it that much, I’ve been using Charles http://www.xk72.com/charles/wiki/flash_remoting or Service Capture http://kevinlangdon.com/serviceCapture/ instead.

  3. Daniel
    Posted April 26, 2007 at 2:23 pm | Permalink

    It only worked for me when I defined the classpath search on the publishing settings for the movie.. but it worked after all

  4. Aran
    Posted April 29, 2007 at 9:05 pm | Permalink

    Hmmm.

    I am having some issues with this method. If I don’t include the classpath or include a invalid classpath, I get the expected class not found errors, but if I include the correct path I get ~100 errors on compilation complaining like below:

    The class being compiled, ‘mx.remoting.NetServiceProxyResponder’, does not match the class that was imported, ‘NetServiceProxyResponder’.
    The class or interface ‘mx.remoting.NetServiceProxyResponder’ could not be loaded.
    The class being compiled, ‘mx.remoting.NetServiceProxy’, does not match the class that was imported, ‘NetServiceProxy’.
    The class or interface ‘mx.remoting.Connection’ could not be loaded.
    .
    .
    .

    Any ideas ? I’ve tried clearing ASO etc

    If I include the path on the FLA in publish settings then all seems ok, but this means for any remoting project I have to go an set up classpaths etc.

  5. matt
    Posted May 1, 2007 at 8:41 pm | Permalink

    would someone be so kind as to tell me exactly where to put the files and how to make my flash 8 fla work in cs3? (probably a dumb question. sorry) perhaps an example file?
    thanks…

  6. Aran
    Posted May 6, 2007 at 5:48 pm | Permalink

    @Matt

    The easiest way (for a 1 off project) is to download the zip in the original post, and extract to your the same folder where your project lives. Flash will always look for classes from where your FLA resides as root

    If you want to use the remoting classes on multiple projects, put the mx folder somewhere central (like c:\dev) and then map a classpath to your FLA : file > publish settings > (flash tab) actionscript 2.0 settings > classpath (target) > browse for where you created you common class location (c:\dev). Yiou can add as many classpaths as you require for each FLA.

  7. Posted May 30, 2007 at 7:08 am | Permalink

    You should check out ssr. http://osflash.org/projects/ssr. It works a lot like as3lrf but there is no need for listeners which is a bad implementation for remoting. The downside of as3lrf is that you add listeners to the actual service object. But let’s say you make 3 service calls, each result gets mapped to the same onResult handler. That’s screwy. With ssr you declare onResult and onFault handlers with each service call, you can also specify a maxAttempt limit and a timeout interval. SSR is a better replacement for a remoting package.

  8. Matt
    Posted December 17, 2007 at 12:08 pm | Permalink

    Thank you!!! Thanks to your files, which I skillfully pasted into “C:\Documents and Settings\USERNAME\Local Settings\Application Data\Adobe\Flash CS3\en\Configuration\Classes” and “C:\Program Files\Adobe\Flash CS3\en\Configuration\Classes” I now have flash remoting working in Flash 9. :)

  9. Marc
    Posted January 22, 2008 at 4:00 pm | Permalink

    Thanks to Aaron Smith for pointing out ’ssr’!!

  10. Posted March 31, 2008 at 12:44 am | Permalink

    thanks, for the suggestion.

  11. Johnny
    Posted May 27, 2008 at 1:45 pm | Permalink

    Hi All,
    I copy the files to the path that you said.
    Still not working for me.
    This is the code that I’m using
    Here is my code that I’m using:

    import mx.remoting.NetServices;
    import mx.remoting.NetDebug;
    mx.remoting.debug.NetDebug.initialize();
    import mx.controls.Alert;
    import mx.controls.gridclasses.DataGridColumn;
    import BubbleMovieClip;
    import com.Msgs;

    // Set up variables for the URL and service paths
    var myURL = “http://localhost/flashservices/gateway”;
    var servicePath = “com.myDomain.myApp”;

    // Connection hasn’t been initialized; create connection and service objects
    if (initialized == null) {
    initialized = true;
    NetServices.setDefaultGatewayUrl(myURL);
    var myConnection_conn = NetServices.createGatewayConnection();
    var myService = myConnection_conn.getService(servicePath, this);
    }
    Do I have to change anything?
    Thanks

    Johnny

  12. Posted December 21, 2009 at 4:14 am | Permalink

    Thanks for still providing this info!
    You saved my day!

  13. Hal Eagar
    Posted February 25, 2010 at 10:54 pm | Permalink

    Win 7 : CS4 PATH
    C:\Users\USERNAME\AppData\Local\Adobe\Flash CS4\en\Configuration\Classes\mx

  14. ven
    Posted July 13, 2010 at 2:16 am | Permalink

    I’m using MAC
    Does anyone know about the path to put class file on MAC?
    and I use CS5 didn’t find something like “flash” or “mx” file in the /Libary/Application Support/Adobe….

3 Trackbacks

  1. [...] http://blog.vixiom.com/2007/04/17/actionscript-20-flash-remoting-with-flash-cs3/ [...]

  2. [...] blog van Vixiom Axioms met interessante comments… [...]

  3. [...] por el mismo problema encontre este link en que relataba lo mismo que hice yo anteriormente y que en ste caso asombrosamente le [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word