Vixiom Axioms

April 17, 2007

ActionScript 2.0 Flash Remoting with Flash CS3

Filed under: ActionScript, Flash, Flash Remoting Alastair @ 1:49 pm

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.

Digg! submit ActionScript 2.0 Flash Remoting with Flash CS3 to stumbleupon.com submit ActionScript 2.0 Flash Remoting with Flash CS3 to del.icio.us submit ActionScript 2.0 Flash Remoting with Flash CS3 to reddit.com Like this post? subscribe to the feed.

13 Comments »

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

    Pingback by kineticz interactive » Blog Archive » Flash CS3 with remoting — April 20, 2007 @ 8:44 am

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

    Comment by Josh — April 21, 2007 @ 10:49 am

  3. 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.

    Comment by KreeK — April 21, 2007 @ 4:00 pm

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

    Comment by Daniel — April 26, 2007 @ 2:23 pm

  5. 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.

    Comment by Aran — April 29, 2007 @ 9:05 pm

  6. 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…

    Comment by matt — May 1, 2007 @ 8:41 pm

  7. @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.

    Comment by Aran — May 6, 2007 @ 5:48 pm

  8. 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.

    Comment by Aaron Smith — May 30, 2007 @ 7:08 am

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

    Pingback by ActionScript 2.0 Remoting Components in Flash CS3… at PePo’s weblog — September 12, 2007 @ 11:27 am

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

    Comment by Matt — December 17, 2007 @ 12:08 pm

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

    Comment by Marc — January 22, 2008 @ 4:00 pm

  12. thanks, for the suggestion.

    Comment by placement papers — March 31, 2008 @ 12:44 am

  13. 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

    Comment by Johnny — May 27, 2008 @ 1:45 pm

RSS feed for comments on this post. TrackBack URL

Leave a comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image

Powered by WordPress