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_184.108.40.2065.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.
- Download the fla file: mergersl.fla
Some of Our TLF Tutorials
- AS3 Flash CS5: Cool Text Effects with TLF Text
- Flash CS5: 3D Text Effect, Embedding Fonts via TextFlow.fontLookup
- Flash CS5: XML Markup and Runtime Loading of TLF Text with AS3
- Flash CS5: Double 3D Text Effect with TLF Text
- Multicolumn Text on the Fly with New AS3 TLF Text Classes in Flash CS5
- New AS3 Text Layout Classes in Flash CS5 - Tour and Example