Using Webservice classes in a “actionscript-only” Flex3 project

When using webservice classes in an “actionscript-only” Flex project, you have to make sure to include these lines of code before anything else in you class:

 var resourceManagerImpl:Object = ApplicationDomain.currentDomain.getDefinition("mx.resources::ResourceManagerImpl");
 Singleton.registerClass("mx.resources::IResourceManager", Class(resourceManagerImpl));

If you don’t include this code you will get an error like this:

Error: No class registered for interface 'mx.resources::IResourceManager'.
at mx.core::Singleton$/getInstance()
at mx.resources::ResourceManager$/getInstance()

This is due to a bug in Flex3 compiler, read more info on this bug here:  http://bugs.adobe.com/jira/browse/SDK-12205

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon] Share in Google Buzz Share this on google buzz!

john

I am currently working as a Senior Flash Developer and Solutions Architect for R/GA in NYC.



Opensocial: Test Google FC

GFC iPhone app

User Activity:

Flash CS5 Poll

<-- -->