2 Replies Latest reply on Aug 5, 2011 8:17 AM by Santanu Karar

    Weird message using Cairngorm 2.2 with Flash CS5

    Santanu Karar Level 1

      Hello,

       

      First of all, I'm using Flash Builder 4.0, with Cairngorm 2.2.swc, Flash CS5 (as my application library SWC maker).

       

      One Note: this problem suddenly occur today, but I can't remember we changed any setup than the last few days!

       

      What we were doing is, we have a Flex project, say at C:\myProject\Flex

      Our Flash working files are situated at C:\myProject\Flash

       

      During exporting any SWC files from our Flash FLAs, we are using some classes which were already defined in the Flex project folder (i.e. C:\myProject\Flex\src). We import those class paths in the Flash FLAs by keeping the path location in the "ActionScript Settings" inside Flash. Everything was working fine for a past few days, we were able to import Flex created classes and able to export SWC keeping their references inside the Flash. Suddenly today something got messed up. We started having a compiler error during exporting any SWC from the FLAs -

       

      "C:\myProject\flex\src\actionScripts\myModelLocator.as, Line 32 1045: Interface ModelLocator was not found"

       

      This "myModelLocator.as" is an usual model locator singleton class that uses inside any Cairngorm project by implementing ModelLocator class. I've further checked whether the ModelLocator reference is exists in that class file, but they are there! Even Flex project runs very smoothly without any such compiler error!

       

      Anyway, I've tried again to map the Cairngorm2.2.swc path inside from Flash (ActionScript Settings/Library Path) - now that error is vanished, but a new one I have -

       

      1046: Type was not found or was not a compile-time constant: ResourceBundle.

      I'm totally out of any idea what is happening suddenly.

       

      Any help would be highly appreciated and indeed supportable for me.

       

      Thank you.

       

       

      Rgds.

       

      Santanu Karar

        • 1. Re: Weird message using Cairngorm 2.2 with Flash CS5
          Amy Blankenship Level 4

          Old versions of Cairgorm have a hard dependency on the Flex Framework, so there's not really any advantage to using it in a Flash project--you have to pull the whole Flex Framework along with it.  If you're using Cairngorm, you're not bothered by Singletons (which IMO are extremely bad practice), so you might find PureMVC a viable alternative.

           

          If you want to use a Framework that actively encourages good practice, try Robotlegs. It was designed from the ground up to work either in Flash or Flex, and it uses Dependency Injection rather than having everything reach out to touch some global state variable.

           

          HTH;

           

          Amy

          • 2. Re: Weird message using Cairngorm 2.2 with Flash CS5
            Santanu Karar Level 1

            Thank you Amy,

             

            I'll do look in Robotlegs. But meantime our project dependencies with Cairngorm framework and we've did a fair amount of work with it.

             

            Searching over the forums in-line with this problem, I've found some this 'type' of problem (I emphasized on type because they're not actually meant with Flash IDE but Flex only), I've noticed a weird thing there's even. In multiple places I've seen people come out with not any probable alternative but by renaming some classes.

             

            I starts inspecting my Flash project, and try to understand which probable class import cause this problem. I've found one class - which I whenever imports into the Flash its throwing the eorror, but not with any other Flex classes! Being curious, I've changed the name of the class keeping the same codes within, import it again in Flash, and voila! It worked! Weird! Isn't it?

             

            But now I again can export SWC and run the Flash project without any trouble!

             

            Fully weird.