Hey all,
I’ve been through an incredibly painful process of getting XIFF to compile in the Flash IDE and thought that I’d share what I found in the hope of sparing others the same experience. As most of you probably already know - XIFF3 has moved XIFF from being a general Actionscript Library to being a Flex library. Unfortunately, I was unaware of this change before I opened my big mouth on a project that I’m currently working on and promising Jabber (Open Fire) support in the app which for reasons too lengthy to go into here had to be built in the Flash IDE and not Flex.
Being the proud and stubborn guy that I am, I had to come up with a solution. I chatted with some of the Dave here and he suggested that I grab the specific flex files form the sdk (mx.blah.blah). I just grabbed the whole ‘mx’ folder from the flex 3 sdk and placed it in my project folder. When I attempted this I began getting this error:
No class registered for interface ‘mx.resources::IResourceManager’.
which, I must admit, made me a little sad… After doing some research, I found a way around this as well… Evidently this error has been a problem for flex developers updating projects form Flex 2 to Flex 3 as well as me… The solution is to:
- Add these two classes in your Main.as or whatever your Constructor class is:
import flash.system.ApplicationDomain;
import mx.core.Singleton;
- Add this as the first line of your application in the Main class constructor function:
var resourceManagerImpl:Object = flash.system.ApplicationDomain.currentDomain.getDefinition(“mx.resources::Resou rceManagerImpl”); Singleton.registerClass(“mx.resources::IResourceManager”, Class(resourceManagerImpl));
After making these changes I tried compiling and was once again a happy developer with a working chat
Instructions sans attempts at humor:
- Copy the mx folder from the flex3sdk - C:\flex3sdk\frameworks\projects\framework\src
1a - If you don’t have it already get it here: http://www.adobe.com/products/flex/flexdownloads/
1b - I have mine here: C:\flex3sdk
-
Paste it into the same folder as your .fla
-
Add the following lines to your Main.as (Constructor Class) file:
import flash.system.ApplicationDomain;
import mx.core.Singleton;
- Add the following line to your Main.as constructor function:
var resourceManagerImpl:Object = flash.system.ApplicationDomain.currentDomain.getDefinition(“mx.resources::Resou rceManagerImpl”); Singleton.registerClass(“mx.resources::IResourceManager”, Class(resourceManagerImpl));
I also found it to be very helpful to run asdoc (comes with the sdk - command line tool) on the xiff library to get some minimal documentation…
You should be off and running… Good luck!
Phil