The Tip and Comments

Flash CS5 provides the new powerful Text Layout Framework (TLF) text engine. At authoring time, you can use the TLFTextField instead of Classic Text. If you work with text programmatically, AS3 provides many new classes for TLF. At the end of this page, we list some of our tutorials that deal with TLF text.

There is one catch, though. Whenever you use TLF text, your SWF file will need to load at runtime a Runtime Shared Library (RSL), textLayout_X.X.X.XXX.swz. The SWF file will look for the RSL on the local machine first, then on adobe.com website, then, finally, in its own directory on your server. During this process a built-in preloader runs.

The download process is usually painless and quick. Sometimes, however, it is better to avoid it. For example, when authoring an AIR app for Android. In that case, you might be better off compiling the RSL into your app. Otherwise, the app will require the Internet Access permission. Another example when it might be better to compile the RSL into your SWF is when the SWF will be loaded by another SWF. In that case, both the buit-in preloader and the download of the RSL may cause problems.

To compile the RSL into your SWF, simply change the ActionScript 3 publish settings in your fla file as illustrated below. Compiling the RSL into SWF adds only about 130 KB to your SWF. In comparison, whenever you have instances of TLF text on the stage, about 50 KB are added to SWF. To compile RSL into your SWF, change AS3 publish settings. Either from Publish Settings or from ActionScript Settings, access Advanced ActionScript 3.0 Settings panel. Under 'Default linkage', choose 'Merge into code' and click OK.

Below is a sample fla file with the settings applied. You will notice that when you test the movie, the file textLayout_1.0.0.595.swz will NOT appear next to the SWF file. Also, when you check Simulate Download, the built-in preloader will not appear. With the default publish settings, you will se the swz file and Simulate Dowload in the Test Player will reveal the preloader.

Some of Our TLF Tutorials

Back to Flash CS5 Tutorials              Back to Flash and Math Home

We welcome your comments, suggestions, and contributions. Click the Contact Us link below and email one of us.

Adobe®, Flash®, ActionScript®, Flex® are registered trademarks of Adobe Systems Incorporated.