22 Replies Latest reply on Nov 5, 2010 1:43 AM by mengha

    Flex module sometimes is blank.

    mengha

      Hi guys,

       

      My application consistens two parts : client side and server side. Client side is created using flex . Client side includes several modules under different tabs.When first access the client by browser, the module will load data from server backend.

      I met such problems that the module sometimes be blank. There's nothing in the tab.I moniter the http request and response when blank tab is met . There's data in http request content  and the data is same with  content of http response when tab is correct.

       

       

      I have already be troubled with this for several days and could some one give some  advice about what problem maybe? Flex sdk3.2 is used.

       

      Thanks very much.

       

      Ivan.

        • 1. Re: Flex module sometimes is blank.
          mengha Level 1

          if someone can tell about the possible reason and something needs to pay attenation, it will be great helpful.

          • 2. Re: Flex module sometimes is blank.
            Flex harUI Adobe Employee

            Add some code that checks the size and position of the displayobjects and

            also their visible property.

            • 3. Re: Flex module sometimes is blank.
              mengha Level 1

              Thanks for reply. However I am not sure whether it's UI component related. Since the problem isn't occured  everytime. Sometime the content can be displayed under all tabs. And sometimes, the content of all modules under different tabs are blank . It looks more like all data can't be displayed correctly everytime in flash player.

              • 4. Re: Flex module sometimes is blank.
                Flex harUI Adobe Employee

                In a ViewStack/TabNavigator, the views that haven't been made visible yet

                can get funky sizes under certain conditions, especially when things that

                would dictate their size like images and modules aren't loaded yet.

                 

                That's why I suggested looking there first.

                • 5. Re: Flex module sometimes is blank.
                  mengha Level 1

                  Hi ,

                   

                  I added some debug code to show the displayobject's visible property, size and position. They are same with the values when tabs are fulfilled with data. And beside this, I also do some testing :

                  1. Access single module (under single tab) by testing page, the result is successfully

                  So I am thinking the problem is module loading problem. Does there exist some known issue about tabnavigator ?

                   

                  Thanks.

                  • 6. Re: Flex module sometimes is blank.
                    Flex harUI Adobe Employee

                    I don't know of any issue with TabNavigator and modules other than, like I

                    said, the display objects can get bad sizes.  Are you using moduleLoader in

                    the TabNavigator?  Check the child and its size and visibility.

                    • 7. Re: Flex module sometimes is blank.
                      mengha Level 1

                      yes, I am using moduleLoader to load swf modules in TabNavigator. I add event listener of moduleLoader  , when the ready event happens, it will display the modueLoader's visible property and moduleLoader's child's visible property.

                       

                      However, no matter whether the blank error happens or not, these visible property's value are all true.

                       

                      I am thinking to force the module under single Tab refresh after loading data. But I try to change the page size and drag the browser, no change. So seems it's not about the single module's tab refresh problem.

                       

                      Still not get the root cause. And not sure what to try next.

                      • 8. Re: Flex module sometimes is blank.
                        Flex harUI Adobe Employee

                        Keep walking through the child's size and its children's size and visibility

                        • 9. Re: Flex module sometimes is blank.
                          mengha Level 1

                          This time , I show all child's visible property, size and position property, there's no difference between empty tab and correct tabs. And the empty tab still occurs sometimes.

                          What I am thinking that,could it be a problem with flash player? As the data is loaded and flex UI component is initialized successfully?

                          • 10. Re: Flex module sometimes is blank.
                            Flex harUI Adobe Employee

                            I doubt it is a flash player problem.  Fundamentally, your app is setting up

                            a tree of display objects, and if you set all the properties correctly

                            (visible, x, y, width, height, alpha, scaleX, scaleY, etc) you will see what

                            you want.  One or more of those properties and objects are not setup

                            correctly.

                             

                            Have you set up your debugging such that you can click on something when the

                            module is blank and dump the tree then?  If you dump the tree based on some

                            event like show it might be ok then and get changed later.

                            1 person found this helpful
                            • 11. Re: Flex module sometimes is blank.
                              mengha Level 1

                              yes, I build flex debug ENV using flex builder and debug version flash player. Regarding dumping tree, do you mean print the object status in memory ?  The blank problem  happens when first access the application. I mean, when accessing the flex client application, it will do some initial job including loading data, and display UI component.  So do you have some suggestion abou to dump the tree? If we wan to dump the whole display tree, we need to add some debug code in TabNavigator page ,right ? But the data is loaded using some callback function, I am not sure whether the display object are created then.

                               

                              Does there exist some tool can used to check the flash player problem ?

                              • 12. Re: Flex module sometimes is blank.
                                Flex harUI Adobe Employee

                                You can try FlexSPY.

                                 

                                I would just add a button that adds a mouseDown handler to the app.  Then

                                click on the blank module and trace out properties based on the

                                event.target.

                                • 13. Re: Flex module sometimes is blank.
                                  mengha Level 1

                                  Thanks for the suggestion. I add flexspy button in the first tab. And I moniter the property value tree when empty tab is met. All is same with the value when no errors happen. But I notice one thing:

                                   

                                  1. only one canvas in the tab navigator visible=true at one time. i.e. currently A is the initial page, and you changed canvas b's visible property to true using FlexSPY , the display object of canva B will be overlapped with canvas A's object.  This is the regular scenario, For the empty tab case, nothing change when you do above action..

                                   

                                  So I am thinking whether there exist such a scenario:


                                  as you know, when switching between tabs, the current canvas' visible property will change from false to true. And does there exist sometimes, only the visible property value changed , the display object isn't changed to display?

                                   

                                  The action happened during first lanuching is :
                                  1. get a list of tabs

                                  2. create canvas based on above list and add to tabnavigator

                                  3. then initial from the first canvas to last.

                                   

                                  My application will create most UI component at the launch time

                                  • 14. Re: Flex module sometimes is blank.
                                    Flex harUI Adobe Employee

                                    Navigators use the visible property to select which view to show.

                                     

                                    I don't recall any issues with navigators not setting the visibility

                                    property and having it work correctly.

                                     

                                    Are you saying that when you change tabs, the new selected tab does not get

                                    set to visible=true?  What is the TabNav's selectedIndex when that happens?

                                     

                                    It also occurred to me that if the module or its children get in an

                                    invalidation loop they may never finish initializing and they will have

                                    visible=false.

                                    • 15. Re: Flex module sometimes is blank.
                                      mengha Level 1

                                      Hi,

                                       

                                      No, when you change tabs, the new selected tab will be set to visible=true.

                                      I guess when switching tab , below action happens:

                                      1. the selected tab's visible property is set to true

                                      2. Some action to display the object

                                       

                                      I am thinking whether there exist a scenario that 1st steps is done, and the displayobject is initialized but problems happens when display these project in the canvas.

                                       

                                       

                                      Since the displayobject of selected tab 's visible property is set to true, I think the module's initialiation work should be ok.

                                       

                                      Thanks

                                      • 16. Re: Flex module sometimes is blank.
                                        Flex harUI Adobe Employee

                                        I assume you have a TabNavigator with ModuleLoader children.  You are saying

                                        that the moduleLoader's visible=true as expected.   Are you also claiming

                                        that all children of the moduleLoader are the same whether blank or not?  I

                                        would make sure their visible properties are set correctly.

                                        • 17. Re: Flex module sometimes is blank.
                                          mengha Level 1

                                          Yes,

                                           

                                          The tabnavigator will first create several canvas ,then as the next step , for every canvas, add moduleLoader as the children.

                                          When switching tab,  current tab's visible property will change from false to true. And for the moduleLoader and all displayobject in module , the visible property's value is always true.

                                           

                                          Yes, all children of the moduleLoader are the same blank when blank happens.

                                           

                                          So I think the problem should occur on the botton layer . what do you think ?

                                          • 18. Re: Flex module sometimes is blank.
                                            Flex harUI Adobe Employee

                                            UIComponent wraps the visible property.  That it reports may not be what the

                                            player sees.  There is an initialized property on UIComponents.  If false,

                                            then the visible property does not reflect what the player sees.

                                             

                                            If you can reproduce the problem in a simple test case, post it.

                                            • 19. Re: Flex module sometimes is blank.
                                              mengha Level 1

                                              Not sure how to check the initialized property value of UIComponent. I just monitered the initilized property of Canvas , moduleLoader etc., initialized=true when empty tab meets.

                                               

                                              This problem occurs when maintance legacy code. One thing occured to me, is there one way to check flex compatibility?  Since this is legacy code,I'd like to check it's compatible with flex sdk v3.2 I used.

                                              • 20. Re: Flex module sometimes is blank.
                                                Flex harUI Adobe Employee

                                                You can dump out the SWF with SWFDump.  There will be version tags in the

                                                class definitions.

                                                 

                                                I use the debugger to check initialized properties.

                                                • 21. Re: Flex module sometimes is blank.
                                                  mengha Level 1

                                                  Okay, I got what you mean. The value of initialized property is always true . So the possiblitiy you supposed don't exist

                                                   

                                                  I also try to use swfdump to decompile swf  file in installed build ENV, find string

                                                  slot 1: const <q>[namespace]http://www.adobe.com/2006/flex/mx/internal::VERSION:<q>[public]::String = 3.0.0.0

                                                  Does this mean my product is buit using flex 3.0.0.0?

                                                   

                                                  Till now, two possibility comes into mind:

                                                  1. Some potential bug in flex sdk

                                                  2. Call flex sdk by mistake

                                                   

                                                  However still can't narrow down the problem.  Feel a little crazy about the problem. .After such long time discussion, do you have some possible reason ?

                                                  • 22. Re: Flex module sometimes is blank.
                                                    mengha Level 1

                                                    Hi Guy,

                                                     

                                                    Finally we find the root cause ,when blank happens, the explictWidth and explictHeight property of canvas is 0 . After changing both value to NaN,now the blank problem is fixed.  I am not sure whether there's some conflict in flex layout.  Possible reason is accept. Thanks.