RPC for Actionscript projects

| | Comments (0) | TrackBacks (0)
Error: No class registered for interface 'mx.resources::IResourceManager'. If you have experienced this before, you are in for a bumpy ride. There are loads of these errors floating about when using the flex sdk to compile your project with. The reasons are vast and different but basically boils down to dependencies. Classes within the flex framework depend on a heap of other classes, that is why it is known as an Application framework.

This is something we all experience on a daily basis, we want to use some piece of code written for a previous project, and quite often we find ourselves spending way more time to make the code standalone that we would have like to. Very similarly, I want to use the RPC package for various reasons but without using the whole Flex Application framework.

So where does ResourceManager fit in and why is there no class registered for interface IResourceManager?

Why RPC?

The RPC package has loads of useful classes. One of the reasons why I wanted to use it and not re-invent the wheel, following DRY (don't repeat yourself). After all, by now we all value and understand the use of reusable code. HTTPServices, WebServices, AMF support & RemoteObjects to name but a few, all services used in mid to larger sized Flash projects these days.

When Adobe announced part of the FlexSDK will be open source I was hoping this will be included. These services were used many times before and wanted to use them on a future project. But alas, there seem to be a problem. Without knowing the exact structure of the Flex framework (which is available by the way), you won't necessarily be able to use the class you want without initialising the entire Flex framework. Actionscripters wanting to use Flex components inside Flash projects know this all to well.

This is probably the major topic of discussion at the moment surrounding frameworks. The core should be exactly that, a core, and be subject for different kinds of inspection and testing. It should allow for plug-and-play. In my view any class not related directly to the core should be standalone, i.e. black-boxed.

No class registered for interface 'mx.resources::IResourceManager'.

Error messages can be so vain, err I mean vague. Doing a search reveals that this error message is not really helping. What we do nkow is that IResourceManager is an interface possibly used by ResourceManager, the logical assumption. So what does the class ResourceManager do? Very simply, it manages the localised compile errors that is displayed by the FlexSDK when compiling against it. So the actual error we are seeing is actually retrieved by the class that implements this interface itself, how ironic. The problem is, the RPC package is rather big, and a lot of these dependencies are initialised when only one of the RPC classes are used like HTTPService. In the end it did add some 200Kb to my end result which wasn't something to smile about. So maybe there is scope for a light-weight rpc package for pure Actionscript projects. Any takers?

How do we fix it?

We don't cause Adobe already did. They fixed it pretty damn fast and that was very impressive. I had to change this post a few times as I wanted to suggest some solutions. But luckily all you would have to do is get the build version as stated by Robert Vollmar  - "Confirmed fixed in 3.0.x build 3.0.0.963."

Resources

0 TrackBacks

Listed below are links to blogs that reference this entry: RPC for Actionscript projects.

TrackBack URL for this entry: http://www.wezside.co.za/cgi-bin/mt/mt-tb.cgi/32

Leave a comment


Type the characters you see in the picture above.