ASAP Movie Management

One of the fundamentals of ASAP Framework is the Object Oriented way of loading and managing external movies. This page describes how to use ASAP to create multipage sites.

Most Flash projects consist of more than one movie, with clear benefits: users do not have to download one megafile; designers and developers can divide their work better. Out of the box, Flash does not offer much help in managing separate movies, leaving developers on their own. Each developer might find a best way of doing this, but the end result will be different each time: some movies will start before being loaded, some movies will start only after hitting a page refresh. And the lack of rules becomes a maintainance nightmare for development teams.

ASAP Framework offers two basic principles that make movie management consistent and controllable:

  1. Each separate movie is controlled by a specialized subclass of LocalController
    • The specialized controller only knows about the SWF it controls: the data it needs, the interface elements on the stage.
  2. Each movie is loaded through MovieManager
    • All loaded movies can be accessed through MovieManager, although in practice almost all communication happens through events. Because MovieManager is a singleton, it can be accessed from every part.

The premise is fundamental OO: each part in the project only knows as much as it should, and nothing more. Good programming practice is the top down approach: lower level (more specialized) objects talk to their environment by sending out events. Higher level objects subscribe to lower level events and deal with these as they occur.

See Access to the controller from lower classes to see how lower level interface elements can access their LocalController.
This schema illustrates how movie handling is done:
movie_management_glance.png

The main movie controller (often called AppController) orders MovieManager to load a new movie. Once the movie has been loaded and its LocalController initialized, MovieManager sends out a MovieManagerEvent (onMovieReady) passing the local LocalController with the event.

In more detail:
movie_management.png

The Simple Application Demo shows how to use this in practice.

Topic attachments
I Attachment Action Size Date Who Comment
pngpng movie_management.png manage 143.5 K 08 Oct 2006 - 17:49 ArthurClemens Movie management schema
pngpng movie_management_glance.png manage 26.0 K 07 Nov 2006 - 22:04 ArthurClemens Movie management in a glance
Topic revision: r4 - 08 Nov 2006 - 19:47:54 - StephanBezoen
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding ASAP? Send feedback