Macromedia Flash File Format (SWF)

recompiled with RAW HTWL

Control Tags


Introduction Basic Types Display List Control Tags
Shapes (Examples Shapes) Gradients Buttons
Sprites Fonts and Text Shape Morphing Bitmap
Sounds Actions ActionScripts Reference

Control Tag Contents

Control Tags
SetBackgroundColor
FrameLabel
Protect
End
ExportAssets
ImportAssets
EnableDebugger
DefineBitsPtr

Control Tags

There are three categories of ControlTags:
  1. Display List
  2. Action
  3. Control
Display List and Action tags are covered in other sections (see The Display List and Actions ).

Control tags manage some overall aspects of files and frames.

SetBackgroundColor

The SetBackgroundColor tag sets the background color of the display. (Macromedia Flash (SWF) 1)

     SetBackgroundColor     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 9     
     BackgroundColor           RGB           Color of the movie background     
    SwfJava v0.0: how to create a SetBackgroundColor tag    
    new SetBackgroundColor (    
        RGB rgb    
    );    


    XWF v0.0: how to declare a SetBackgroundColor tag    
    <SetBackgroundColor color="#3366FF" />    


FrameLabel

The FrameLabel tag gives the specified Name to the current frame. This name is used by ActionGotoLabel to identify the frame.
     FrameLabel     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 43     
     Name           Null-terminated STRING . (0 is NULL)           Label for frame     
    SwfJava v0.0: how to create a FrameLabel tag    
    new FrameLabel (    
        SWFString name    
    );    


    XWF v0.0: how to declare a FrameLabel tag    
    <FrameLabel name="(string)" />    


Protect

The Protect tag marks a file as not importable for editing in the authoring tool. If the Protect tag contains no data (tag length = 0), the .SWF file cannot be imported. If this tag is present in the file, the authoring tool should prevent loading of the file for editing. (Macromedia Flash File Format (SWF) 2)

If the Protect tag does contain data (tag length is not 0), the Macromedia Flash .SWF file can be imported if the correct password is specified. The data in the tag is a null-terminated string which specifies a MD5 encrypted password. Specifying a password is only supported by the Macromedia Flash 5 .SWF file format.

The MD5 password encryption algorithm used was written by Poul-Henning Kamp and is freely distributable. It resides in the FreeBSD tree at src/lib/libcrypt/crypt-md5.c. The MD5 password encryption algorithm is also used by the EnableDebugger tag.
     FrameLabel     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 24     
    SwfJava v0.0: how to create a Protect tag    
        
    {not yet implemented}    
        


End

The End tag marks the end of a file. This should always be the last tag in a file. (Macromedia Flash (SWF) 1)
     End     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 0     
    SwfJava v0.0: how to create a End tag    
        
    new End();    
        


    XWF v0.0: how to declare a End tag    
        
    no declaration is necessary for a End tag    
        


ExportAssets

The ExportAssets tag exports assets from the Macromedia Flash (SWF) file so that other Macromedia Flash (SWF) can ImportAssets as linked assets. (Macromedia Flash (SWF) 5)

ExportAssets makes repetitive portions of a Macromedia Flash movie or a series of Macromedia Flash movies available for import. For example, ten Macromedia Flash movies that are all part of the same website can share an embedded custom font if one movie embeds the font and sets the font to "export". Exporting gives the font a special identifier string. As well as sharing embedded fonts, a Macromedia Flash (SWF) can share other symbol types (linked assets) like movie clips, buttons and sounds.

Also see ImportAssets.
     ExportAssets     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 56     
     count           UI16           number of assets to export     
     tag1           UI16           tag of character to export 1     
     asset1           Null-terminated STRING . (0 is NULL)           identifier string of asset 1     
     ...                             
     tagN           UI16           character tag to assign asset N     
     assetN           Null-terminated STRING . (0 is NULL)           identifier string of asset N     
    SwfJava v0.0: how to create a ExportAssets tag    
        
    {not yet implemented}    
        


ImportAssets

The ImportAssets tag imports assets from another Macromedia Flash (SWF) file as a linked asset. (Macromedia Flash (SWF) 5)

"Client" Macromedia Flash (SWF)s can import assets like fonts that are stored in "server" Macromedia Flash (SWF)s (that are ideally cached on an end user's local system). The importing Macromedia Flash (SWF) references the exporting Macromedia Flash (SWF) with a URL. The URL needs to include the asset identifier string. Imported assets are resolved and stored in a ScriptThread’s SCharacter dictionary.

Note that the URL can be absolute or relative. If it's relative, it's resolved relative to the location of the importing Macromedia Flash .SWF.
     ImportAssets     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 57     
     URL           Null-terminated STRING . (0 is NULL)           URL points to the asset in the “server” SWF and includes the asset identifier string     
     count           UI16           number of assets to import from URL     
     tag1           UI16           character tag to assign asset 1     
     asset1           Null-terminated STRING . (0 is NULL)           identifier string of asset 1     
     ...                             
     tagN           UI16           character tag to assign asset N     
     assetN           Null-terminated STRING . (0 is NULL)           identifier string of asset N     
    SwfJava v0.0: how to create a ImportAssets tag    
        
    {not yet implemented}    
        


EnableDebugger

The EnableDebugger tag enables debugging. Note that the password in the EnableDebugger tag is encrypted using the MD5 algorithm, in the same way as the Protect tag. (Macromedia Flash (SWF) 5)
     EnableDebugger     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 58     
     Password           Null-terminated STRING . (0 is NULL)           Password authenticates the Splayer's ScriptPlayer     
    SwfJava v0.0: how to create a EnableDebugger tag    
        
    {not yet implemented}    
        


DefineBitsPtr

The DefineBitsPtr tag creates a bitmap that references another bitmap that has already been allocated. This special tag is for performance optimization in the editor only. (Macromedia Flash (SWF) 5)
     DefineBitsPtr     
     Field           Type           Comment     
     Header           RECORDHEADER           Tag ID = 1023     
     Bitmap Bits           UI32           Reference to another bitmap that has already been allocated     
    SwfJava v0.0: how to create a DefineBitsPtr tag    
        
    {not yet implemented}    
        


Introduction Basic Types Display List Control Tags
Shapes (Examples Shapes) Gradients Buttons
Sprites Fonts and Text Shape Morphing Bitmap
Sounds Actions ActionScripts Reference