Flash Actionscript Smooth Horizontal Text Scrolling

Well sounds simple. But it caused me a severe headache.

I created a movieclip with a text field, that needed to scroll horizontally from left to right.
The text must be readable because you must type this word before it reaches the end...

The movieclip graphics moved very smoothly, only the textfield wasn't.

To solve the problem I needed to perform the following operations:

  • Set the anti-alias method for this textfield to "Optimize for Animation"
  • Well that was not enough, after a lot of trying, I found out I also needed to Embed the font of the textfield, for a completely smooth animation..

    Very frustrating...
    And I don't like the solution because my swf file is bigger... But it will do for now..

    Text Measurements with Flash Actionscript 2

    Today I found a great class to help me calculating text metrics in Flash. It's really nice, you can use it to locate every single word / line etc. in a (for instance) wrapping textField. Actionscript 3 has got nice built in methods for this, but unfortunately, for the current project I need to develop with Actionscript 2. Jack Doyle created a very nice actionscript 2 class for this:

    http://blog.greensock.com/textmetrics/

    Flash Actionscript XML.send( … ) doesn’t send

    Once in a while you require Flash... Well yesterday was such a day :-)
    I'm was working on a Flash component that tries to submit data back to the server...
    I don't have a lot of flash experience so I still don't know all its quirks.

    Well I was trying to submit an XML document the following way:

    var xml:XML = new XML()
    //... fill xml ...
    xml.send( '/my/url' );
    

    Well... it didn't submit! No interaction with the server...
    After some searching I discovered this was caching. Always that stupid caching...
    So I solved this by adding a timestamp:

    xml.send( '/my/url?ts=' + ( new Date() ).getTime() )
    

    Again the timestamp to the rescue...