5 Replies Latest reply on Dec 3, 2010 4:48 PM by FM_Flame

    Changing modules with url property of moduleLoader causes buttonBarButtons transition to flicker?

    FM_Flame Level 1

      http://filip.nedyalkov.net/moduleLoaderTesting1/ - source code view enabled - the mxml file is testing2

       

      So as topic says, I am using moduleLoader to load 2 different modules with the use of buttonBar which has custom skin for the mid button which I use for all 3 buttons in it. In that skin there is a transition defined for up, over and selected states, which is fairly simple.

       

      In order for the problem to be seen, I use another default buttonBar under it. Clicking on it's buttons will change the selectedIndex of the custom button bar so he has the same selected button as the bottom buttonBar.

       

      So if you click on "no module" you will see that the transition is fluent, the icon goes a little darker and it's fine. But if you click to load module1 or module2, there is flickering with the icons that get in the selected state which kinda matches when the new module child pops up.

       

      So my question is simple - how do I fix this?

       

      Any suggestions are welcome. Feel free to download the code and test yourself.

        • 1. Re: Changing modules with url property of moduleLoader causes buttonBarButtons transition to flicker?
          Flex harUI Adobe Employee

          If the loading of the module requires significant initialization time it

          could affect smoothness of transition.  Make sure your modules are

          lightweight as possible. Use the profiler to get better information.

          • 2. Re: Changing modules with url property of moduleLoader causes buttonBarButtons transition to flicker?
            FM_Flame Level 1

            Hi, thanks for the reply.

             

            If you checked my example source code you would see that both of my modules are alike just the rectangle fill has different color:

             

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009" 
                       xmlns:s="library://ns.adobe.com/flex/spark" 
                       xmlns:mx="library://ns.adobe.com/flex/mx"
                        width="100%" height="100%">
                
                <s:Group width="100%" height="100%">
                    <s:Rect width="100%" height="100%">
                        <s:fill>
                            <s:SolidColor color="0x000000" />
                        </s:fill>
                    </s:Rect>
                </s:Group>
                
            </mx:Module>

             

            How more lightweight the modules can be...

            I did some more testing and there is no flickering when the module is unloaded only when loaded. And also if I set a timer to load the module after the transition is over there's no flickering. Also there is no flickering for texts and also there is less but still sometimes flickering if the transition target is not rect but group. And also if I set the transition to be not 200 ms as in my example but 1000 ms or more then there is no flickering again which doesn't make any sense to be, cause the flickering in a slower animation should be way more obvious that in a very fast one but it is in the countrary.. no flickering at all. Any ideas ?

             

            So to fix the problem I have 2 options:

            1) setting at least 1000 ms transition where I don't have flickering

            2) use a timer for shorter transitions and load the module after it's ended

             

            But this "hacking" doesn't seem very appealing to me so that's why I am asking here if this is a bug or what ?

             

            Message was edited by: FM_Flame

            • 3. Re: Changing modules with url property of moduleLoader causes buttonBarButtons transition to flicker?
              FM_Flame Level 1

              So having in mind my previous post do you think I should report this as a bug?

              • 4. Re: Changing modules with url property of moduleLoader causes buttonBarButtons transition to flicker?
                Flex harUI Adobe Employee

                I'm not sure what you are claiming is a bug.  Flash is single-threaded with

                deferred rendering.  You have to plan accordingly.  You can add your vote to

                one of the concurrency/threading bugs if you want.

                • 5. Re: Changing modules with url property of moduleLoader causes buttonBarButtons transition to flicker?
                  FM_Flame Level 1

                  Well does it make sense to you to have flickering when the transition is 200-900 ms (I tested) and not when it's 1000+ ms long?

                   

                  If it did flicker always at the point of the module being intitialized and displayed I would definitely say ok, that obviously is interupting the transition cause maybe a lot of operations are going on under to load an empty module...

                   

                  But why does it flicker under 900 ms and not over 1000 ms duration ? Does Flash being single-threaded with deferred rendering explains this, I don't really know how that works, but if you say that it's normal I will accept it as a fact, but If you think it could be a bug I will post a bug report, so what do you think?

                   

                  P.S.

                  I will run some tests to see If I have flickering if I use moduleManager to load the modules instead of moduleLoader and post the results.