Packageaway3d.loaders
Classpublic class Swf
InheritanceSwf Inheritance AbstractParser Inheritance flash.events.EventDispatcher

File loader for swfs with injected vector data.

Public Properties
 PropertyDefined by
 InheritedcenterMeshes : Boolean
Controls the automatic centering of geometry data in the model, improving culling and the accuracy of bounding dimension values.
AbstractParser
 Inheritedcontainer : Object3D
Retuns a 3d container object used for storing the parsed 3d object.
AbstractParser
 InheritedgeometryLibrary : GeometryLibrary
Retuns a geometryLibrary object used for storing the parsed geometry data.
AbstractParser
  libraryClips : Array
An array of library ids to extract from the swf.
Swf
 Inheritedmaterial : Material
Overrides all materials in the model.
AbstractParser
 InheritedmaterialLibrary : MaterialLibrary
Retuns a materialLibrary object used for storing the parsed material objects.
AbstractParser
 Inheritedmaterials : Object
Overides materials in the model using name:value pairs.
AbstractParser
 InheritedparsedChunks : int
Returns the total number of data chunks parsed
AbstractParser
 InheritedparseTimeout : int
Defines a timeout period for file parsing (in milliseconds).
AbstractParser
  perspectiveFocus : Number
A perspective scaling value used in conjuction with perspectiveOffset.
Swf
  perspectiveOffset : Number
An offset used to separate individual faces in a clip to counteract sorting artifacts.
Swf
  scaling : Number
A scaling factor for all geometry in the model.
Swf
 InheritedtotalChunks : int
Returns the total number of data chunks available
AbstractParser
Protected Properties
 PropertyDefined by
 Inheritedini : Init
Instance of the Init object used to hold and parse default property values specified by the initialiser object in the parser constructor.
AbstractParser
 Inherited_symbolLibrary : Dictionary
AbstractParser
Public Methods
 MethodDefined by
  
Swf
(init:Object = null)
Creates a new Swf object.
Swf
 Inherited
addOnError(listener:Function):void
Default method for adding a parseError event listener
AbstractParser
 Inherited
addOnProgress(listener:Function):void
Default method for adding a parseProgress event listener
AbstractParser
 Inherited
addOnSuccess(listener:Function):void
Default method for adding a parseSuccess event listener
AbstractParser
  
load(url:String, init:Object = null):Loader3D
[static] Loads and parses a swf file into a 3d container object.
Swf
  
parse(data:*, init:Object = null):ObjectContainer3D
[static] Creates a 3d mesh object from the raw binary data of an swf file.
Swf
 Inherited
Parses 3d file data.
AbstractParser
 Inherited
removeOnError(listener:Function):void
Default method for removing a parseError event listener
AbstractParser
 Inherited
removeOnProgress(listener:Function):void
Default method for removing a parseProgress event listener
AbstractParser
 Inherited
removeOnSuccess(listener:Function):void
Default method for removing a parseSuccess event listener
AbstractParser
Protected Methods
 MethodDefined by
 Inherited
buildContainers(containerData:ContainerData, parent:ObjectContainer3D):void
AbstractParser
 Inherited
AbstractParser
 Inherited
AbstractParser
Events
 EventSummaryDefined by
 Inherited Dispatched when the 3d object parser fails to parse a file.AbstractParser
 Inherited Dispatched when the 3d object parser progresses by one chunk.AbstractParser
 Inherited Dispatched when the 3d object parser completes a file parse successfully.AbstractParser
Property detail
libraryClipsproperty
public var libraryClips:Array

An array of library ids to extract from the swf. If no library ids are defined, all library items are used. If no library items exist, the content found on the stage is used.

perspectiveFocusproperty 
public var perspectiveFocus:Number

A perspective scaling value used in conjuction with perspectiveOffset.

perspectiveOffsetproperty 
public var perspectiveOffset:Number

An offset used to separate individual faces in a clip to counteract sorting artifacts.

scalingproperty 
public var scaling:Number

A scaling factor for all geometry in the model. Defaults to 1.

Constructor detail
Swf()constructor
public function Swf(init:Object = null)Parameters
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.
Init Parameters
 libraryClips:Array
 scaling:Number (default = 1)
 perspectiveOffset:Number (default = 0)
 perspectiveFocus:Number (default = 1000)

See also

Method detail
load()method
public static function load(url:String, init:Object = null):Loader3D

Loads and parses a swf file into a 3d container object.

Parameters
url:String — The url location of the file to load.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.

Returns
Loader3D — A 3d loader object that can be used as a placeholder in a scene while the file is loading.
parse()method 
public static function parse(data:*, init:Object = null):ObjectContainer3D

Creates a 3d mesh object from the raw binary data of an swf file.

Parameters
data:* — The binary data of a loaded file.
 
init:Object (default = null) — [optional] An initialisation object for specifying default instance properties.

Returns
ObjectContainer3D — A 3d container object representation of the swf file.
Wiki link
Click to go to the wiki page for 'away3d.loaders.Swf'

Code examples

Comments