13 Replies Latest reply on Mar 26, 2007 5:03 PM by Greg Dove

    Text Effects (Dynamically)

    babo_ya Level 3
      http://orcad.optimumreturn.com/TextEffect.png

      I'm trying to achieve text effects as above dynamically.
      1) User can enter any text in a text input
      2) put each characters into a movieclip
      3) Somehow, I need to achieve those text effects as above.
      Note : I was able to create a curve effect which doesn't require to resizing width & height. And I also tried to use Matric to skew but, I can't set the height on both right & left side they are always same.
      Please help me.
      Thank you.
        • 1. Re: Text Effects (Dynamically)
          babo_ya Level 3
          Please someone help me!!
          • 2. Re: Text Effects (Dynamically)
            babo_ya Level 3
            HELPHELP!
            • 3. Re: Text Effects (Dynamically)
              kglad Adobe Community Professional & MVP
              you'll need to use the flash string and array methods to put each character of your text in its own textfield and to control and add those textfields you'll want to make them children of a movieclip.
              • 4. Re: Text Effects (Dynamically)
                babo_ya Level 3
                >>you'll need to use the flash string and array methods to put each character of your text in its own textfield and to control and add those textfields you'll want to make them children of a movieclip.

                thanks for your reply.

                -Yes I've done exactly what you said already. But, the problem seems like each character is its own movieclip and in order to achieve these text effects ( http://orcad.optimumreturn.com/TextEffect.png) I have to be able to change the height of right side without changing the left height. Please help me how to do this.
                Thanks,
                • 5. Re: Text Effects (Dynamically)
                  kglad Adobe Community Professional & MVP
                  your textfield should have its registration point in the center of your movieclip. you can then adjust the movieclips _width and _height properties.
                  • 6. Re: Text Effects (Dynamically)
                    Greg Dove Level 4
                    I haven't used the transform matrix myself, but I'm pretty sure you can't do what you're asking.

                    From what I've read you can skew, scale, move, etc in actionscript same as you can in authoring environment, but what you want to do is a distort (that's what its called in the flash transform menu). I don't believe you can do that in any simple way at least, dynamically. I'm keen to know if I'm wrong, 'cause it looks good. (Although it makes me think of MS Word Textart )
                    • 7. Re: Text Effects (Dynamically)
                      babo_ya Level 3
                      GWD,
                      Thanks for ur answer.
                      yes that's what I thought initially, someone knows a site (I'm NOT allow to see this site because it's our competitive and let's just put it this way, it's a company rule). This is what drives me crazy it is possible but, I can't think of anyway.

                      kglad, I know you are one of the smartest in here. Please help me. Yes, I know how to change _widht & _height using the center registration point. But, what I'm trying to do is like GWD said, *distort text

                      Thanks,
                      • 8. Re: Text Effects (Dynamically)
                        kglad Adobe Community Professional & MVP
                        you can distort the text. but you have limited ability to distort individual letters with actionscript.

                        here's an example of a valley effect. create a textfield (tf) in a movieclip with linkage id = mc.

                        create an input text field on your main timeline with instance name iTF and attach the code below to a frame on the main timeline:

                        • 9. Re: Text Effects (Dynamically)
                          Greg Dove Level 4
                          Kglad that's a good way to do it without warping individual characters. Not sure how this works, but it might help as a demonstration of something that looks like what babo_ya wants to do.. (unless its a site you're not allowed to look at babo_ya !)

                          http://theflashblog.com/?p=217

                          Other than that, all I can suggest would be a very complicated approach.
                          It would involve automating some conversion (via jsfl) of a font through to individual character movieclip assets with the actionscript drawing code for each character, and some additional code internally in each asset that handles its leftHeight and rightHeight (or scale) properties for example. I have a command plug-in now that allows me to convert an individual character to actionscript drawing commands (e.g. after I use Break Apart) called sel2draw, but its not to the level of sophistication you would need to do this. You would need to set up something like this and do it for all the characters you would possibly use. Like I said... I think this would be possible... but (for me at least) very complicated. Things you take for granted when using textfields might become a little more complicated too! Kerning etc.
                          • 10. Re: Text Effects (Dynamically)
                            babo_ya Level 3
                            Thanks,
                            let's say somehow I have all my characters in MC.

                            >>some additional code internally in each asset that handles its leftHeight and rightHeight (or scale) properties

                            How??? I just looked http://theflashblog.com/?p=217 , 'Sandy' 3D example which uses a bitmapObject, Do you think I can use 'Sandy 3D' distort image to distort text charcaters inside of movieclip?

                            Thanks,
                            • 11. Re: Text Effects (Dynamically)
                              Greg Dove Level 4
                              I gave two options. And the second one wouldn't be easy at all. Its like coverting your fonts tcharacter by character o actionscript drawing commands, so you wouldn't even see anything in the library assets. But with that you could set it up to work how you want. I have no idea what it might do to the size of your movie compared with say a regular embedded font.

                              Using the Sandy class probably warrants exploring first as it might do what you want ifts its working with bitmapCache copies of the text and not the text itself. I don't know much about it though.
                              • 12. Re: Text Effects (Dynamically)
                                babo_ya Level 3
                                hmn.... Not sure what you mean GWD.
                                I have two options, either tell me boss that it is impossible or find a solution.
                                I'm leading toward... 'This is impossible" but, i need to come up with reasons why I can't do this.

                                Anyway, Thanks for your help, GWD and kglad.
                                • 13. Re: Text Effects (Dynamically)
                                  Greg Dove Level 4
                                  Sorry if I wasn't clear... I don't know the answer about whether Sandy is the thing you need. But its the only thing that at first glance appears close to what you want to do.

                                  I do believe the other option I mentioned is possible, but if I were you I wouldn't tell my boss that.
                                  Actionscript has a drawing api, so you can draw things in code at runtime. The letter a could be drawn by actionscript code for example. But it would also need to know how to adjust its points before drawing to perform the distort that you want. so each character would be a movie clip asset with no visual graphics... they only appear when the code runs at runtime. I base the idea on this : http://www.laxudra.com/dload/macromedia/DevNet%20Resource%20Kit/devnet/devnet/extras/sel2d raw.html which I have from my devnet subscription days. By itself its not adequate... but it can convert a character to actionscript drawing commands. You would need to do something far more sophisticated and have it batch process all the individual font characters you needed using jsfl. I think this approach is a huge project... for me anyway... maybe not for others who know jsfl well.... I wouldn't want to tackle it. I know what I would tell my boss.