Packagevegas.display
Classpublic class SWFInfo
InheritanceSWFInfo Inheritance Object

This tool class can check a swf bytecode and returns the list of all class inside.

Example :

     import vegas.display.SWFInfo ;
     
     import flash.display.Loader ;
     import flash.net.URLRequest ;
     import flash.system.LoaderContext ;
     
     var complete:Function = function( e:Event ):void
     {
         trace("-------") ;
         
         var swf:ByteArray = e.currentTarget.bytes ;
         
         trace( "SWF complete : " +  swf  ) ;
         
         var info:SWFInfo  = new SWFInfo( swf ) ;
         
         trace( "SWF frameCount         : " + info.frameCount ) ;
         trace( "SWF frameRate          : " + info.frameRate  ) ;
         trace( "SWF length             : " + info.length  ) ;
         trace( "SWF version            : " + info.version  ) ;
         trace( "SWF symbol class names : " + info.symbolClassNames ) ;
         
         trace("-------") ;
     }
     
     var loader:Loader = new Loader() ;
     
     loader.contentLoaderInfo.addEventListener( Event.COMPLETE , complete ) ;
     
     addChild( loader ) ;
     
     var request:URLRequest = new URLRequest( "library.swf"  ) ;
     
     loader.load( request ) ;
     



Public Properties
 PropertyDefined By
  bytes : ByteArray
The ByteArray representation of the SWF.
SWFInfo
  compressed : Boolean
[read-only] Indicates the compressed byte value the specified SWF.
SWFInfo
  fileLength : int
[read-only] Indicates the length of entire file in bytes.
SWFInfo
  frameCount : int
[read-only] Indicates the total number of frames in the file.
SWFInfo
  frameRate : int
[read-only] Indicates the frame delay in number of frames per second.
SWFInfo
  symbolClassNames : Array
[read-only] Returns the Array representation of all symbol class defines in the library of the SWF.
SWFInfo
  version : int
[read-only] Indicates the version value of the specified SWF.
SWFInfo
Public Methods
 MethodDefined By
  
SWFInfo(bytes:ByteArray = null)
Creates a new SWFInfo instance.
SWFInfo
  
loadBytes(b:ByteArray):void
Loads the passed-in SWF bytes and launch the mapping of the object.
SWFInfo
  
reset():void
Resets the informations and the bytes reference of this instance.
SWFInfo
Public Constants
 ConstantDefined By
  COMPRESSED : int = 0x43
[static] The compressed tag value (0x43)
SWFInfo
  FULL : int = 0x3F
[static] The "full" tag value (0x3F)
SWFInfo
  NOT_COMPRESSED : int = 0x46
[static] The "not compressed" tag value (0x46)
SWFInfo
  SYMBOL_CLASS : int = 0x4C
[static] The "symbol class" tag value (0x4C)
SWFInfo
Property Detail
bytesproperty
bytes:ByteArray

The ByteArray representation of the SWF.


Implementation
    public function get bytes():ByteArray
    public function set bytes(value:ByteArray):void
compressedproperty 
compressed:Boolean  [read-only]

Indicates the compressed byte value the specified SWF.


Implementation
    public function get compressed():Boolean
fileLengthproperty 
fileLength:int  [read-only]

Indicates the length of entire file in bytes.


Implementation
    public function get fileLength():int
frameCountproperty 
frameCount:int  [read-only]

Indicates the total number of frames in the file.


Implementation
    public function get frameCount():int
frameRateproperty 
frameRate:int  [read-only]

Indicates the frame delay in number of frames per second.


Implementation
    public function get frameRate():int
symbolClassNamesproperty 
symbolClassNames:Array  [read-only]

Returns the Array representation of all symbol class defines in the library of the SWF.


Implementation
    public function get symbolClassNames():Array
versionproperty 
version:int  [read-only]

Indicates the version value of the specified SWF.


Implementation
    public function get version():int
Constructor Detail
SWFInfo()Constructor
public function SWFInfo(bytes:ByteArray = null)

Creates a new SWFInfo instance.

Parameters
bytes:ByteArray (default = null)
Method Detail
loadBytes()method
public function loadBytes(b:ByteArray):void

Loads the passed-in SWF bytes and launch the mapping of the object.

Parameters

b:ByteArray

reset()method 
public function reset():void

Resets the informations and the bytes reference of this instance.

Constant Detail
COMPRESSEDConstant
public static const COMPRESSED:int = 0x43

The compressed tag value (0x43)

FULLConstant 
public static const FULL:int = 0x3F

The "full" tag value (0x3F)

NOT_COMPRESSEDConstant 
public static const NOT_COMPRESSED:int = 0x46

The "not compressed" tag value (0x46)

SYMBOL_CLASSConstant 
public static const SYMBOL_CLASS:int = 0x4C

The "symbol class" tag value (0x4C)