Packagecom.desuade.partigen.libraries
Classpublic class PELFile
InheritancePELFile Inheritance Object

Language Version : ActionScript 3
Since : 20.11.2009
Runtime Versions : AIR 1.0, Flash Player 9.0.0

Loads and provides methods for PEL (Partigen Emitter Library) files.



Public Properties
 PropertyDefined By
  author : String
The author of the library
PELFile
  hasError : Boolean = false
Did the PEL file have an error on load.
PELFile
  library : Object
This is the library object that contains all the groups of presets
PELFile
  name : String
The name of the library
PELFile
  onError : Function = null
Method to be called if there's an error loading the PEL 2 args are passed: PELFile, error
PELFile
  onLoad : Function
Method to be called after the PEL file is loaded 1 arg is passed: PELFile
PELFile
  path : String
The original path of the .pel file
PELFile
  require : Number
The version of Partigen the library requires
PELFile
  shared : Boolean = true
If the loaded SWC files should share their Classes or keep them in their own ApplicationDomain
PELFile
  swcs : Object
An Object containing all the loaded SWC objects
PELFile
  version : Number
The version of the library
PELFile
  xmlLibrary : XML
The original XML of the library
PELFile
Public Methods
 MethodDefined By
  
This creates a PELFile that can be used to load preset emitter settings dynamicly at runtime.
PELFile
  
getAllClasses(fullname:Boolean = true, duplicates:Boolean = false):Array
This returns an Array of Strings listing all available loaded classes
PELFile
  
getClass(className:String):Class
This returns the direct Class from the passed string
PELFile
  
load(file:String, shared:Boolean = true):void
This loads the specified PEL file.
PELFile
Public Constants
 ConstantDefined By
  ERROR_LOAD_FILELOAD : String = Error loading PEL file
[static] This error is sent to the onError method when there's an error loading the actual pel file
PELFile
  ERROR_LOAD_MISSINGXML : String = No library XML definition found
[static] This error is sent to the onError method when there's no library.xml file found
PELFile
  ERROR_LOAD_REQUIRED : String = Version does not meet requirments
[static] This error is sent to the onError method when the current version of Partigen does not meet the libraries required version
PELFile
  ERROR_PARSINGXML : String = Error parsing the XML file
[static] This error is sent to the onError method if there's an error parsing the XML file
PELFile
  PEL2 : Namespace
[static] Namespace for version 2.0 of the PEL spec.
PELFile
  VERSION : Number = 2.0
[static] Version of the Partigen Emitter Library (PEL) spec this class was designed for. If the a pel file is loaded with a future spec, the details will be traced through the debug class, but will still load.
PELFile
Property Detail
authorproperty
public var author:String

The author of the library

hasErrorproperty 
public var hasError:Boolean = false

Did the PEL file have an error on load.

libraryproperty 
public var library:Object

This is the library object that contains all the groups of presets

nameproperty 
public var name:String

The name of the library

onErrorproperty 
public var onError:Function = null

Method to be called if there's an error loading the PEL

2 args are passed: PELFile, error

onLoadproperty 
public var onLoad:Function

Method to be called after the PEL file is loaded

1 arg is passed: PELFile

pathproperty 
public var path:String

The original path of the .pel file

requireproperty 
public var require:Number

The version of Partigen the library requires

sharedproperty 
public var shared:Boolean = true

If the loaded SWC files should share their Classes or keep them in their own ApplicationDomain

swcsproperty 
public var swcs:Object

An Object containing all the loaded SWC objects

versionproperty 
public var version:Number

The version of the library

xmlLibraryproperty 
public var xmlLibrary:XML

The original XML of the library

Constructor Detail
PELFile()Constructor
public function PELFile()

This creates a PELFile that can be used to load preset emitter settings dynamicly at runtime.

Method Detail
getAllClasses()method
public function getAllClasses(fullname:Boolean = true, duplicates:Boolean = false):Array

This returns an Array of Strings listing all available loaded classes

Parameters

fullname:Boolean (default = true) — To return the full qualified class name if true, false returns the short class name.
 
duplicates:Boolean (default = false) — Include duplicates in the result. Defaults to false.

Returns
Array — Array of class names
getClass()method 
public function getClass(className:String):Class

This returns the direct Class from the passed string

Parameters

className:String — The name of the class to get

Returns
Class — The Class, or null if it's not found
load()method 
public function load(file:String, shared:Boolean = true):void

This loads the specified PEL file.

Parameters

file:String — A string to the location of the PEL file
 
shared:Boolean (default = true) — If the loaded SWC files should share their Classes or keep them in their own ApplicationDomain

Constant Detail
ERROR_LOAD_FILELOADConstant
public static const ERROR_LOAD_FILELOAD:String = Error loading PEL file

This error is sent to the onError method when there's an error loading the actual pel file

ERROR_LOAD_MISSINGXMLConstant 
public static const ERROR_LOAD_MISSINGXML:String = No library XML definition found

This error is sent to the onError method when there's no library.xml file found

ERROR_LOAD_REQUIREDConstant 
public static const ERROR_LOAD_REQUIRED:String = Version does not meet requirments

This error is sent to the onError method when the current version of Partigen does not meet the libraries required version

ERROR_PARSINGXMLConstant 
public static const ERROR_PARSINGXML:String = Error parsing the XML file

This error is sent to the onError method if there's an error parsing the XML file

PEL2Constant 
public static const PEL2:Namespace

Namespace for version 2.0 of the PEL spec.

VERSIONConstant 
public static const VERSION:Number = 2.0

Version of the Partigen Emitter Library (PEL) spec this class was designed for.

If the a pel file is loaded with a future spec, the details will be traced through the debug class, but will still load. If the new spec is too different, there can be issues.