C# Class SWFProcessing.SWFModeller.SWF

Top-level object for a SWF movie.
Inheritance: SWFProcessing.SWFModeller.Modelling.Timeline
显示文件 Open project: WeeWorld/Swiffotron Class Usage Examples

Public Methods

Method Description
AddCharacter ( string id, ICharacter c ) : void

Adds a character, e.g. a shape or an image to the SWF dictionary.

AddScript ( DoABC abc ) : void

Adds a script.

ClassByName ( string name ) : AS3ClassDef

Find a class by name.

ClipFromClass ( AS3ClassDef clazz ) : Timeline

Finds the movieclip that has been bound to a class.

GenerateTimelineScripts ( ) : void

Generates the timeline scripts.

GetCharacter ( string id ) : ICharacter

Gets a character from the internal dictionary.

IDFor ( ICharacter c ) : string

This is brutal and slow, but it's only in debug builds for unit test output, so we just don't care.

LookupInstance ( string qname ) : PlaceObject

Finds a placed character on the stage by its instance name.

MarkCodeAsTampered ( ) : void

Marks all code as tampered which will force dissassembly and re-assembly. Useful in testing.

MergeScript ( DoABC abc ) : void

This takes an existing script and merges it into our script by merging constants and classes together in a terrifying clash of opcodes. Where we have multiple scripts, we will merge into the first one, because we need to pick one and have no way to decide what would be best.

NewEditText ( string id ) : EditText

Creates a new EditText field in the SWF.

NewSprite ( string id, uint frameCount, bool exportForScript ) : Sprite

Create a new sprite and add it to the SWF.

NewStaticText ( string id ) : StaticText

Creates a new StaticText field in the SWF.

SWF ( SWFContext ctx, bool generateScripts ) : System.Collections.Generic

Initializes a new instance of a SWF with the same defaults as the Flash IDE.

ScriptProc ( ScriptProcessor sd ) : void

Runs a delegate function on each script in the SWF.

TextReplaceInCode ( string find, string replace ) : void

Does a search and replace on strings used in the actionscript code.

ToString ( ) : string

Private Methods

Method Description
AddFont ( SWFFont font ) : void

Adds a font to the SWF.

ClassProc ( ClassProcessor cp ) : void

Runs a delegate function on every class in the SWF.

MapClassnameToClip ( string className, Timeline tl ) : void

Maps the classname to a clip.

MethodProc ( AbcCode mp ) : void

Runs a delegate function over every method in the SWF.

RenameMainTimelineClass ( string classQName ) : void

Renames the main timeline class.

ToStringModelView ( int nest, StringBuilder sb ) : void

Method Details

AddCharacter() public method

Adds a character, e.g. a shape or an image to the SWF dictionary.
public AddCharacter ( string id, ICharacter c ) : void
id string A name to refer to this character in the dictionary.
c ICharacter The character to add.
return void

AddScript() public method

Adds a script.
public AddScript ( DoABC abc ) : void
abc SWFProcessing.SWFModeller.ABC.DoABC The abc code.
return void

ClassByName() public method

Find a class by name.
public ClassByName ( string name ) : AS3ClassDef
name string The class name.
return AS3ClassDef

ClipFromClass() public method

Finds the movieclip that has been bound to a class.
public ClipFromClass ( AS3ClassDef clazz ) : Timeline
clazz AS3ClassDef The class to look up
return SWFProcessing.SWFModeller.Modelling.Timeline

GenerateTimelineScripts() public method

Generates the timeline scripts.
public GenerateTimelineScripts ( ) : void
return void

GetCharacter() public method

Gets a character from the internal dictionary.
public GetCharacter ( string id ) : ICharacter
id string The id of the character to fetch.
return ICharacter

IDFor() public method

This is brutal and slow, but it's only in debug builds for unit test output, so we just don't care.
public IDFor ( ICharacter c ) : string
c ICharacter
return string

LookupInstance() public method

Finds a placed character on the stage by its instance name.
public LookupInstance ( string qname ) : PlaceObject
qname string The qualified name, which is a dotted path through /// nested instances to the instance you want, starting from the root /// timeline.
return PlaceObject

MarkCodeAsTampered() public method

Marks all code as tampered which will force dissassembly and re-assembly. Useful in testing.
public MarkCodeAsTampered ( ) : void
return void

MergeScript() public method

This takes an existing script and merges it into our script by merging constants and classes together in a terrifying clash of opcodes. Where we have multiple scripts, we will merge into the first one, because we need to pick one and have no way to decide what would be best.
public MergeScript ( DoABC abc ) : void
abc SWFProcessing.SWFModeller.ABC.DoABC The script to merge into our one.
return void

NewEditText() public method

Creates a new EditText field in the SWF.
public NewEditText ( string id ) : EditText
id string The id (library name).
return EditText

NewSprite() public method

Create a new sprite and add it to the SWF.
public NewSprite ( string id, uint frameCount, bool exportForScript ) : Sprite
id string A unique ID as supplied by valid SWF data
frameCount uint The number of frames on the sprite's /// timeline.
exportForScript bool If a sprite is exported for script, it will /// appear at the start of the SWF file.
return SWFProcessing.SWFModeller.Characters.Sprite

NewStaticText() public method

Creates a new StaticText field in the SWF.
public NewStaticText ( string id ) : StaticText
id string The id (library name).
return StaticText

SWF() public method

Initializes a new instance of a SWF with the same defaults as the Flash IDE.
public SWF ( SWFContext ctx, bool generateScripts ) : System.Collections.Generic
ctx SWFContext An optional object intended solely to give error messages /// some context.
generateScripts bool True if you want to generate the default /// timeline scripts.
return System.Collections.Generic

ScriptProc() public method

Runs a delegate function on each script in the SWF.
public ScriptProc ( ScriptProcessor sd ) : void
sd ScriptProcessor The delegate to run.
return void

TextReplaceInCode() public method

Does a search and replace on strings used in the actionscript code.
public TextReplaceInCode ( string find, string replace ) : void
find string The text to find.
replace string The new text to replace it with.
return void

ToString() public method

public ToString ( ) : string
return string