This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
3,136 Views 8 Replies Last post: 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

Tags: xiff, flashide
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

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

yes the code is already in *LoginDialogMain* and thats the Main (and only) created/instantiated class in the Main.fla. I tested both, in fla and the Main-Class File. Same results.

Yes I am using CS3 / AS3.

 

thanks,

sebastian

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

yes I use

3.0.0 Beta 1 -- April 2nd, 2008

of XIFF

 

and the lated Flex3SDK copied mx-Classes.

 

I will now try to export to AIR, as that tshould already Flex components embeded.

Sebastian Wagner Bronze 8 posts since
Aug 25, 2008
Currently Being Moderated
Aug 25, 2008 9:00 AM in response to: Sebastian Wagner
Re: Compiling XIFF with the Flash IDE - Solution

but it seems like I got no luck today: http://www.igniterealtime.org/community/message/177685

 

thanks of course for any advice

tty

More Like This

  • Retrieving data ...

Bookmarked By (0)