If you receive an error message “ArgumentError: Error #1508: The value specified for argument font is invalid” when publishing a SWF file, the font used by TLF text wasn’t recovered during the conversion process.
The error example in the output panel is placed below:
"ArgumentError: Error #1508: The value specified for argument font is invalid.
at flash.text::Font$/registerFont()
at Main_fla::MainTimeline()" |
Steps to resolve this error:
- Open the source FLA file in Adobe Flash Professional.
- Open the .AS file the font is registered in. The .AS filename can be found in the “Document Class field”: File > Publish Settings > ActionScript settings >Document Class.In our example it would be:
"Main_fla.MainTimeline"
One can see it in the last line of the error message (see above).
- Find out the class name the font is registered to. Enter “flash.text.Font.registerFont” into the search box.
- Find the line “flash.text.Font.registerFont (…)“. The class name of the required font should appear within curly braces, e.g.:
"flash.text.Font.registerFont(Main_fla.Font1)"
Thus the class name of the required font is:
"Main_fla.Font1"
- Open the “Library” panel (Ctrl+L).
- Click the Library’s contextual menu and select “New Font”
- In the emerged pop-up window “Font embedding” select the “ActionScript” tab.
- Select the “Export for ActionScript” checkbox in the “Linkage” section.
- Enter the fully qualified class name including the package name into the “Class” field. The name applied to our example would look like:
"Main_fla.Font1"
- Select the “TLF (DF4)” in the “Outline Format” section and click “Ok”.
The above workaround should fix the SWF file publishing error.