Date: 2010-05-10 04:17:02 -0700 (Mon, 10 May 2010)
Bug: BLZ-522 - Enhancement request to run BlazeDS messaging code in ActionScript outside of a Flex Application.
Doc: Maybe - it'd be good to mention what people need to do if they want to use rpc.swc without a Flex UI component. See the bug for details.
Details: rpc.swc couldn't be used without a Flex UI component before, this was due to:
1- Some client-side classes need to be registered with Flash player; this normally is handled by generated AS code when an MXML is compiled to SWF, but when MXML is not involved, one needs to register these classes manually.
2- LoaderConfig.url is not available outside Flex and this was causing "url is null" error in Channel url token replacement code.
There isn't much we can do for #1, classes still need to be registered with Flash player so strong types are used instead of generic Objects on the client/server. For #2, I added a URLUtil.hasTokens(url:String) method that takes in a url and returns true if the url contains server.name/server.port tokens. Then, I changed Channel url token replacement code to use this new method. This resolves the "url is null" error.