Guest / Items

Flex After Dark | Flex Modules

Get Feed
Flex After Dark | Flex Modules
Description

Flex Modules

Flex Modules are code functionality compiled to dynamically-loadable SWF files that can be loaded and unloaded by an application at run-time.

Modules let you split your application into several pieces, or modules. The main application, or loader, can dynamically load other modules that it requires, when it needs them. It does not have to load all modules when it starts, nor does it have to load any modules if the user does not interact with them.

Any number of applications can share a module, but a module cannot be run by itself, independently of an application.

Modules API

Flex's Module API defines...

IModuleInfo - a handle for a module, provides information such as url and load state

Module - base class for MXML-based modules

ModuleBase - base class for ActionScript-based modules

ModuleLoader - loads modules dynamically at run-time

ModuleManager - singleton, centrally manages dynamically loaded modules

ModuleEvent - dispatched for events in the module lifecycle

Module-related ActionScript classes are defined in the mx.modules package. (The ModuleEvent class is defined in the mx.events package.)

Creating Modules with MXML and ActionScript

The examples below show how to define Modules using MXML and ActionScript. However, inside the <mx:Module> and SampleModule class definitions there really isn't any code defined. This is because aside from extending one the base Module classes there isn't any other code or contract your modules must implement; they're just like any other component.

MXML-based Modules

Modules are defined in MXML using the <mx:Module> tag.

ActionScript-based Modules

Aside from extending one the base Module classes there isn't any other code or contract your modules must implement; they're just like any other component. The key to modules is not how the are created, but how they are loaded .

Loading Modules

Modules are dynamically loaded (and unloaded) at run-time over the network. ...

Original URL

Comments

Report This

Twine is about discovering, collecting and sharing the content that interests you. Learn More

Join Twine

Stats

First Posted By

Who's Interested In This?

Forgot your password?