Skip navigation
4473 Views 8 Replies Latest reply: Aug 25, 2008 9:00 AM by Sebastian Wagner RSS
Philip Double Bronze 14 posts since
Jul 23, 2008
Currently Being Moderated

Aug 18, 2008 12:05 PM

Compiling XIFF with the Flash IDE - Solution

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:

1. Add these two classes in your Main.as or whatever your Constructor class is:

     import flash.system.ApplicationDomain;
   import mx.core.Singleton;

2. 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:

1. 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

2. Paste it into the same folder as your .fla

3. Add the following lines to your Main.as (Constructor Class) file:

     import flash.system.ApplicationDomain;
    import mx.core.Singleton;

4. 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

  • Sebastian Wagner Bronze 8 posts since
    Aug 25, 2008
    Currently Being Moderated
    Aug 25, 2008 7:05 AM (in response to Philip Double)
    Re: Compiling XIFF with the Flash IDE - Solution

    not really, I keep on getting a Message saying: *ResourceManagerImpl* Variable not definied.

    the mx-package is in its place, the Singleton Class can be load for example.

     

    Any idea what went wrong?

     

    thx

    sebastian

      • Sebastian Wagner Bronze 8 posts since
        Aug 25, 2008
        Currently Being Moderated
        Aug 25, 2008 7:35 AM (in response to Philip Double)
        Re: Compiling XIFF with the Flash IDE - Solution

        thx for your time,

         

        yes I tried to add it into the constructor of my very first Class file, as well as adding in the main.fla right instead of importing/instantiate  the first Class.

         

        The import is also available, if did not import the:

        import flash.system.ApplicationDomain;
        import mx.core.Singleton;

         

        before you will get errors like:

        *1120: Access of undefined property Singleton.*

         

        the Main Class file just looks like that:

        package com.tpw.app.modules.sparkweb.logindialog
        {     
             import flash.system.ApplicationDomain;
             import mx.core.Singleton;
         
                public class LoginDialogMain
             {
                  public var className:String;
                  public var model:Object = null;
                  public var view:Object = null;
                  public var controller:Object;
                  
                  public var oMain:Object = null;
         
             public function LoginDialogMain(oMain:* = null)
             {
               var resourceManagerImpl:Object = flash.system.ApplicationDomain.currentDomain.getDefinition("mx.resources::ResourceManagerImpl");
               Singleton.registerClass("mx.resources::IResourceManager", Class(resourceManagerImpl));
               //some more script but certainly executed _after_ the loading
             }
        }
        

         

         

        while in the main.fla I got only:

         

        import com.tpw.app.modules.sparkweb.logindialog.LoginDialogMain;

        var loginDialogMain:LoginDialogMain = new LoginDialogMain(this);

         

        thats it, I'm puzzled

         

        thanks

        sebastian

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points