The error message “The value specified for argument font is invalid”

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:

 

  1. Open the source FLA file in Adobe Flash Professional.
  2. 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).

  3. Find out the class name the font is registered to. Enter “flash.text.Font.registerFont” into the search box.
  4. 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"
  5. Open the “Library” panel (Ctrl+L).
  6. Click the Library’s contextual menu and select “New Font”
  7. In the emerged pop-up window “Font embedding” select the “ActionScript” tab.
  8. Select the “Export for ActionScript” checkbox in the “Linkage” section.
  9. 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"
  10. Select the “TLF (DF4)” in the “Outline Format” section and click “Ok”.

The above workaround should fix the SWF file publishing error.