Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.core 
IFlexModuleFactory 
Packagemx.core
Interfacepublic interface IFlexModuleFactory
Implementors SystemManager

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

The IFlexModuleFactory interface represents the contract expected for bootstrapping Flex applications and dynamically loaded modules.

Calling the info() method is legal immediately after the complete event is dispatched.

A well-behaved module dispatches a ready event when it is safe to call the create() method.



Public Properties
 PropertyDefined By
  preloadedRSLs : Dictionary
[read-only] The RSLs loaded by this IFlexModuleFactory before the application starts.
IFlexModuleFactory
Public Methods
 MethodDefined By
  
Calls the Security.allowDomain() method for the SWF associated with this IFlexModuleFactory plus all the SWFs assocatiated with RSLs preloaded by this IFlexModuleFactory.
IFlexModuleFactory
  
Calls the Security.allowInsecureDomain() method for the SWF associated with this IFlexModuleFactory plus all the SWFs assocatiated with RSLs preLoaded by this IFlexModuleFactory.
IFlexModuleFactory
  
callInContext(fn:Function, thisArg:Object, argArray:Array, returns:Boolean = true):*
A way to call a method in this IFlexModuleFactory's context
IFlexModuleFactory
  
create(... parameters):Object
A factory method that requests an instance of a definition known to the module.
IFlexModuleFactory
  
Get the implementation for an interface.
IFlexModuleFactory
  
Returns a block of key/value pairs that hold static data known to the module.
IFlexModuleFactory
  
Register an implementation for an interface.
IFlexModuleFactory
Property Detail

preloadedRSLs

property
preloadedRSLs:Dictionary  [read-only]

The RSLs loaded by this IFlexModuleFactory before the application starts. RSLs loaded by the application are not included in this list. Information about preloaded RSLs is stored in a Dictionary. The key is the RSL's LoaderInfo. The value is the url the RSL was loaded from.



Implementation
    public function get preloadedRSLs():Dictionary
Method Detail

allowDomain

()method
public function allowDomain(... domains):void

Calls the Security.allowDomain() method for the SWF associated with this IFlexModuleFactory plus all the SWFs assocatiated with RSLs preloaded by this IFlexModuleFactory.

Parameters

... domains

allowInsecureDomain

()method 
public function allowInsecureDomain(... domains):void

Calls the Security.allowInsecureDomain() method for the SWF associated with this IFlexModuleFactory plus all the SWFs assocatiated with RSLs preLoaded by this IFlexModuleFactory.

Parameters

... domains

callInContext

()method 
public function callInContext(fn:Function, thisArg:Object, argArray:Array, returns:Boolean = true):*

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 10, AIR 1.5

A way to call a method in this IFlexModuleFactory's context

Parameters

fn:Function — The function or method to call.
 
thisArg:Object — The this pointer for the function.
 
argArray:Array — The arguments for the function.
 
returns:Boolean (default = true) — If true, the function returns a value.

Returns
* — Whatever the function returns, if anything.

See also

Function.apply

create

()method 
public function create(... parameters):Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

A factory method that requests an instance of a definition known to the module.

You can provide an optional set of parameters to let building factories change what they create based on the input. Passing null indicates that the default definition is created, if possible.

Parameters

... parameters — An optional list of arguments. You can pass any number of arguments, which are then stored in an Array called parameters.

Returns
Object — An instance of the module, or null.

getImplementation

()method 
public function getImplementation(interfaceName:String):Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Get the implementation for an interface. Similar to Singleton.getInstance() method, but per- IFlexModuleFactory.

Parameters

interfaceName:String

Returns
Object

info

()method 
public function info():Object

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Returns a block of key/value pairs that hold static data known to the module. This method always succeeds, but can return an empty object.

Returns
Object — An object containing key/value pairs. Typically, this object contains information about the module or modules created by this factory; for example:
      return {"description": "This module returns 42."};
      
Other common values in the returned object include the following:
  • fonts: A list of embedded font faces.
  • rsls: A list of run-time shared libraries.
  • mixins: A list of classes initialized at startup.

registerImplementation

()method 
public function registerImplementation(interfaceName:String, impl:Object):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Register an implementation for an interface. Similar to the Singleton.registerClass() method, but per- IFlexModuleFactory, and takes an instance not a class.

Parameters

interfaceName:String
 
impl:Object