AS 2.0 Remoting Classes "'Gotcha!"
In incorporating the new AS 2.0 remoting classes into the Ariaware RIA Platform, I ran into a very simple gotcha that others may have come across but which I haven't seen discussed in our neck of the blogosphere:
In order to use the AS 2.0 API, you need to drag one or two components on the Stage -- you can't just import the classes and start using them. The classes are distributed as compiled clips within a library.
This is actually documented in the Help that comes with the new API. From the Flash Remoting Help; Using Flash Remoting MX 2004 -> Flash Remoting application structure overview:
1. From the Window menu in Flash, select Other Panels > Common Libraries > Remoting. 2. From the Library panel, drag the RemotingClasses library onto the Stage. 3. To use the NetDebug class and the NetConnection Debugger, you must also drag the RemotingDebugClasses library to the Stage.4. In the Actions panel, import the ActionScript Flash Remoting classes.
I had skipped points 1-3 and of course got an error stating that the classes (which do not exist in source form in the default classpath) could not be found. This lead me to initially believe that the installation had failed somehow until Peter (Hall) suggested that I look under the Common Libraries folder.
I have to say that this is not an entirely intuitive way of distributing or using classes. I would much prefer it if I didn't have to drag classes on to the Stage and could just import them in code.
It might also be helpful if the otherwise excellent Trio Service Manager tutorial would explicitly state this requirement on Page 5, wherein we are instructed to open a ready-made FLA which, I am assuming, already contains the RemotingClasses component/library.
Update: Richard Leggett just emailed to remind me that the source for the AS2 remoting classes is available for download from Macromedia. In contrast to the size of the installer (which includes quite a bit of help as well as the connector component), the source weighs in at a modest 60k or so.
You should unzip the source and copy it to your First Run\Classes directory and restart Flash.
It would be nice if the installer could be updated so that this is handled automatically.
Comments
I know I already emailed it to you but I'll put it on here for anyone else without the source.
The link for the source code is:
http://download.macromedia.com/pub/flashremoting/mx2004/components/actionscript_2.0/flashremoting_comp_sourcecode.zip
There's no need for the components.
Rich
by richardleggett on 2004-08-03 16:47:29
by satish sangaru on 2006-02-20 12:53:31
No, there are no licensing gotchas :) The AS2 remoting classes are covered by the Flash IDE license/components licenses that you have and OpenAMF and Arp are open source.
by Aral Balkan on 2006-02-20 13:44:35
by daniel on 2009-07-10 14:18:37
by hs on 2009-06-25 14:53:09
by daniel on 2009-07-07 20:19:39