7 Replies Latest reply on Feb 13, 2012 11:39 AM by nfallon55


    nfallon55 Level 1



      Is the SplitViewNavigator available for apps that run on the dektop?  I tried making a desktop app with it and it could not resolve the tag.



        • 1. Re: SplitViewNavigator
          tinylion_uk Level 2

          You need to include the mobile swc into you project




          That has all the ‘mobile’ components.




          They will work fine on desktop.

          • 2. Re: SplitViewNavigator
            nfallon55 Level 1

            Hi Glenn,


            I added the swc when creating the app and still no go.  I get the following errors when I try to run it.


            ArgumentError: Undefined state 'landscape'.

                at mx.core::UIComponent/getState()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UICo mponent.as:10607]

                at mx.core::UIComponent/findCommonBaseState()[E:\dev\4.y\frameworks\projects\framework\src\m x\core\UIComponent.as:10627]

                at mx.core::UIComponent/commitCurrentState()[E:\dev\4.y\frameworks\projects\framework\src\mx \core\UIComponent.as:10381]

                at mx.core::UIComponent/commitProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx\c ore\UIComponent.as:8304]

                at spark.components.supportClasses::GroupBase/commitProperties()[E:\dev\4.y\frameworks\proje cts\spark\src\spark\components\supportClasses\GroupBase.as:1128]

                at spark.components::Group/commitProperties()[E:\dev\4.y\frameworks\projects\spark\src\spark \components\Group.as:886]

                at mx.core::UIComponent/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx \core\UIComponent.as:8219]

                at spark.components::Group/validateProperties()[E:\dev\4.y\frameworks\projects\spark\src\spa rk\components\Group.as:864]

                at mx.managers::LayoutManager/validateProperties()[E:\dev\4.y\frameworks\projects\framework\ src\mx\managers\LayoutManager.as:597]

                at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:783]

                at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1180]



            • 3. Re: SplitViewNavigator
              tinylion_uk Level 2

              Arrr ok.




              Ive not looked at the SplitView but looking at your error it seems to be saying that the component into which you have added your SplitView needs to have portrait and landscape states.




              Have a look inside the SplitView skin. Maybe there is something in there that’s looking for layout state changes. This is total guess work so please feel free to ignore J




              Maybe create a new skin for the SplitView and strip it back to basics and see if that sorts it out.




              Ive been meaning to look at this component myself and will get around to it this week hopefully




              Let me know how you get on. And if you’re really stuck I’ll take a look at lunch today





              • 4. Re: SplitViewNavigator
                nfallon55 Level 1

                Hi Glenn,


                I looked at the skin and there are a lot of references to popout if the device is vertical.  The error is originating from the LayoutManager.as file.  Do you know where I can find that file?



                • 5. Re: SplitViewNavigator
                  nfallon55 Level 1

                  I can fake the look that I get with the SpliViewNavigator by using 3 panels with a viewstack in each one.  Since it is a desktop app it should work.



                  • 6. Re: SplitViewNavigator
                    nfallon55 Level 1

                    Here is the simple solution complete with working SplitViewNavigator.


                    Create a desktop flex app.

                    Add an SWFLoader


                    Drop the following code into the app.  Make sure that the swf that is in you mobile apps debug or release folder is copied into the application.


                    <?xml version="1.0" encoding="utf-8"?>

                    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"



                                           xmlns:ns1="*" creationComplete="initApp()">




                                import flash.system.SecurityDomain;

                                import flash.system.ApplicationDomain;


                                private function initApp():void { 

                                    var context:LoaderContext = new LoaderContext();


                                    contentLoader.loaderContext = context;                

                                    contentLoader.source = "MyNewTest.swf";





                        <s:SWFLoader id="contentLoader"/>







                    • 7. Re: SplitViewNavigator
                      nfallon55 Level 1

                      If you are running the app on the desktop after making it for a mobile device be sure to set the size for the size of the device.


                      I have an app for the Blackberry Playbook so my size is 1024 x 600.  There are 2 places to set the size.  The first is at the top of the code:


                      xmlns:ns1="*" creationComplete="initApp()" width="1024" height="600">


                      and the 2nd is at the SWFLoader tag.


                      s:SWFLoader id="contentLoader" width="1024" height="600"/>


                      Once these spots are set to the dimensions of your mobile app it will display correctly on the desktop.