5 Replies Latest reply on Sep 28, 2010 4:31 AM by YaelAttractv

    Moving text flickers

    YaelAttractv

      Hello folks,

      I am creating a "ticker" vidget which runs on Flash Player, which is mainly composed of moving text (mainly used for news updates, etc). It's composed of a Text field in an HBox together with an image and the HBox is the component moved (every frame I move the HBox's x field by a few pixels to the left which creates the animation). The HBoxes are wrapped together in a Canvas. Here's an example in our demo: http://www.attractv.com/demo/.

      The problem is that the text does not move smoothly and seems to flicker, which at high moving rates can be very irritating. Compare this, for example, with the moving text on http://twitter.com/ website, which moves much more smoothly.

      Is this a Flex problem or could it be the way the vidget is built? Is there a different component or certain style I should be using for the Text component which could make the text move more smoothly?

       

       

      Thanks a lot,

       

      Yael

        • 1. Re: Moving text flickers
          Sharma*Jyoti

          Hello yeal,

                         Try following sample application

          Each time on enter frame x for text is reduce till it become 0. Animate property is used in order to make effect look smoother. Hope it would help you.

           

           

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

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"

          enterFrame="text.x&lt;0?text.x=hbox.width:text.x -= 1;" height="100%" width="100%" verticalAlign="middle">

           

          //trigger binding when x for text change.

           

             <mx:AnimateProperty id="moveTxt" target="{text}" property="{x}" toValue="{text.x}"/>

               <mx:HBox id="hbox" backgroundColor="#474747" height="20" width="100%" backgroundAlpha=".8" horizontalGap="0" paddingLeft="0"      paddingRight="0">

                    <mx:Text id="text" text="!!!!!!!!!!!!This is a scrolling text. X position is changed on enter frame !!!!!!!!!!!!"

                    color="#AFC7C7" fontSize="12"/>

               </mx:HBox>

          </mx:Application>

           

           

          Regards

          Jyoti

          • 2. Re: Moving text flickers
            YaelAttractv Level 1

            Hi Jyoti,

             

            Thanks a lot for such a quick answer. I inserted the AnimatedProperty effect but unfortunately it doesn't seem to make a difference. I"ll elaborate that my Text component is wrapped in an HBox which is wrapped by a Canvas. I could not put the AnimatedProperty inside the Canvas (generated an error), and therefore inserted the effect on the Application level. Is this the way it should be used?

            If you have any more helpful input regarding how to make this work or usage of another effect/component, I will be very thankful!!

             

             

            Best,

            Yael

            • 3. Re: Moving text flickers
              Sharma*Jyoti Level 1

              Hello yael,

               

                             I placed hbox inside canvas and for me its working properly. Have you run my sample present in previous reply?? Is it also  flickering at your end??

               

              Regards,

              Jyoti

              • 4. Re: Moving text flickers
                YaelAttractv Level 1

                Hi Jyoti,

                Unfortunately your sample is also flickering at my end, it's noticeable especially when you change the font color to white and add a higher speed (3 pixels per frame instead of 1). In fact, I tested the same example without using AnimateProperty and it looks almost the same.

                Thanks again for your help and the quick replies. If you have any other rabbits up your sleeve I'll be more than happy to hear about them.

                 

                Best,

                 

                Yael

                • 5. Re: Moving text flickers
                  Sharma*Jyoti Level 1

                  Hello Yael,

                   

                                  At a higher frame rate I also observe this flicker thats why I set it to 1...  well at this point of time I don't have any other solution, if I will find any solution in future, I will surely let you Know.

                   

                   

                  Regards,

                    Jyoti