4 Replies Latest reply on May 27, 2011 10:15 AM by _The Madness_

    Best way to pull spark view nav out of mobilecomponents.swc?

    drkstr_1 Level 4

      I would like to use the new view navigator code introduced in Flex 4.5, however it is important that our mobile apps share the same code base (mostly) as our web and desktop apps. Since these components were only included in the mobile build, what would be the best way to go about merging in these dependancies to our main library, without pulling over the full mobilecomponents.swc (which causes errors when included in a non-mobile app). I believe the errors are being caused by incompatible base class defenitions, but please correct me if my assumption is incorrect.

       

      Does anyone have any suggestions for the best way to pull out the view navigator code without requiring the entire mobile framework, or should I just abandon the concept for now?

       

       

      Thanks for your time!

        • 1. Re: Best way to pull spark view nav out of mobilecomponents.swc?
          Shongrunden Adobe Employee

          You should be able to add the mobilecomponents.swc to a desktop Flex AIR project.  I've done it before with no problems, do you get specific errors?  It's important to note that many of the mobile features require AIR apis so you won't be able to use View/ViewNavigator and other features in a desktop web application that runs in the Flash Player.

          1 person found this helpful
          • 2. Re: Best way to pull spark view nav out of mobilecomponents.swc?
            drkstr_1 Level 4

            Hi, thanks for the reply!

             

            Here is the error I'm getting:

             

            ArgumentError: Undefined state 'landscape'.

                 at mx.core::UIComponent/getState()[E:\dev\hero_private\frameworks\projects\framework\src\mx\ core\UIComponent.as:10596]

             

            The error seems to be related to the theme, but I'm not quite sure what the best way to fix it would be. Is there an underlying flaw in my project set up, or do I need to set some kind of mobile theme in my Flex air project?

             

            The main project includes a number of internal library projects, and each one has mobilecomponents.swc set to merged in code. I also need to be able to build the workspace as part of an automated build, so it's important I understand what the underlying issue is with the project configuration within FB.

             

            I am using Flash Builder 4.5 Premium.

             

            Any aditional insite you can give me will be greatly appriciated.

             

             

            Thanks again!

            • 3. Re: Best way to pull spark view nav out of mobilecomponents.swc?
              drkstr_1 Level 4

              Quick update...

               

              I found frameworks/themes/Mobile/mobile.swc and I imported it using the theme selector in the project config. The project now runs without errors.

               

              Just any FYI, when I reopen the theme selection dialog again, the mobile theme is not listed. I will file a bug report if I have time later today.

               

               

              Thanks for getting me in the right direction!

              • 4. Re: Best way to pull spark view nav out of mobilecomponents.swc?
                _The Madness_

                Thanks a lot! I figured this out before but totally forgot about setting the theme to mobile in the air app!

                 

                :-)

                 

                - Matthew