10 Replies Latest reply on May 14, 2010 3:11 PM by EliezerReis

    Invert text of text control.

    EliezerReis

      Hey,

       

      I need invert the text of my text control so that I can read the  text on a mirror. In this case I have to spin the char all chars, change the order of chars in a word (first char will be the last char) and change the begining of paragraphs, first word of paragraph will be the last word of paragraph.

       

      Some very charitable soul could help me in this problem? I don't know how can I start to do it.

       

      Thanks

        • 1. Re: Invert text of text control.
          David_F57 Level 5

          hi

           

          just mirror it with scaleX

           

           

          <mx:Label id="lbl" text="hello world" scaleX="-1" top="10" left="400"/>

           

           

          David

          1 person found this helpful
          • 2. Re: Invert text of text control.
            EliezerReis Level 1

            Hi,

             

             

            Very stranger. When I used the scaleX="-1" the Label disappeared. I'm using AIR with Flex 3.5.

             

             

            Do you have any idea of why?
            • 3. Re: Invert text of text control.
              Vikash.kumar29 Level 3

              HI,

               

               

              You can either use rotationY = 180 with flash player 10 capabilities like :

               

              <mx:Label text="Inverted Label" horizontalCenter="0" verticalCenter="0" rotationY="180"/>

               

               

              Hope this may helps you and directs you on the correct path

               

              -Vikash

              • 4. Re: Invert text of text control.
                David_F57 Level 5

                hi,

                 

                when you rotate or scale -1 you need to remember that the left position is now the old x - width of control, so if you want a 200 wide control at position x=10 you need to make x 210.

                 

                David.

                • 5. Re: Invert text of text control.
                  GordonSmith Level 4

                  You can't rotate or invert device fonts in older version of the Player or AIR. But it should work if you embed the font.

                   

                  Gordon Smith

                  Adobe Flex SDK Team

                  • 6. Re: Invert text of text control.
                    EliezerReis Level 1

                    Hey,

                     

                    Is like David told me, if I use scaleX="-1" I have to move the axis X of the container. So, I have some questions about my new experiences.

                     

                    What's the difference between scaleX="-1" and rotationX="180"? I know that results are different because when I use the rotation and put a mirror in front the monitor the text isn't readable but with scaleX it's.

                     

                    Is better embed font, even if I use the default font (not set to fontFamily)? Is better embed font even If the font is standard like Arial?

                     

                    Thanks
                    • 7. Re: Invert text of text control.
                      David_F57 Level 5

                      hi,

                       

                      At the risk of being wrong, scaleX -1 is a pixel by pixel miror of the object, with rotation you are changing the angle of the view which basically allows for errors to arise when calculating the new angle, with images you don't notice a tiny discrepancy in the pixel location but you do with text, for what you are doing I think that scalex is a 'cleaner' option.

                       

                      David.

                      • 8. Re: Invert text of text control.
                        GordonSmith Level 4

                        scaleX=-1 and rotation=180 are completely different geometrical transformations. I'll try to illustrate them using ASCII art of x/y axes, but it may not look right depending on the font. Normally the axes look like this

                         

                                  -------- x

                                  |

                                  |

                                  |

                                  y

                         

                        (In computer graphics the y axis goes down, because y=0 is the top of the screen.)

                         

                        Doing scaleX=-1 flips the x axis while leaving the y axis unchagned

                         

                        x --------

                                  |

                                  |

                                  |

                                  y

                         

                        while doing rotation=180 spins the x and y axes around the z axis by half a complete rotation, thereby affecting both:

                         

                                  y

                                  |

                                  |

                                  |

                                  |

                        x --------

                         

                         

                         

                         

                        Gordon Smith

                        Adobe Flex SDK Team

                        1 person found this helpful
                        • 9. Re: Invert text of text control.
                          David_F57 Level 5

                          hi Gordon,

                           

                          Thanks for the info, I knew that there was definitely different calculations done for the 2 types, just never really aware of exactly what was happening (i'm barely self aware let alone any in-depth awareness of what happens between code and display), In the past I have noticed that text suffers much more under rotation than it does in simple scaling, and on a personal observation I feel that in the above use case scale -1 would be better.

                           

                           

                          David.

                          • 10. Re: Invert text of text control.
                            EliezerReis Level 1

                            Hi,

                             

                            Thanks a lot everybody, yours answers was very imporant. Now I  have to scroll large amount of text, if someone can help with  the next topic I am grateful.

                             

                            http://forums.adobe.com/thread/639072?tstart=0