LocalController

Kind of class:class
Inherits from:Dispatcher
Implements:
Classpath:org.asapframework.management.movie.LocalController
File last modified:Thursday, 09 November 2006, 10:57:18
(Virtual) base class for controlling movies locally, either independently or embedded.
Extend this class for each separate movie in your project that requires certain complex controlled functionality.
The base class takes care of communication with the MovieManager, so the movie is known to other movies.

The LocalController functions as controller for everything that happens locally.
For other movies, it functions as a Facade, hiding implementation of details.
The preferred mode of communication with the LocalController is through events, to avoid having to know the actual specific interface.

Summary


Constructor
  • LocalController (inTimeline:MovieClip)
    • Constructor, performs basic initialization, and notifies the MovieManager that the movie has been created.
Instance properties
  • mName : String
    • Name identifier.
  • mTimeline : MovieClip
    • Movieclip that is controlled by the LocalController.
Instance methods
  • notifyMovieInitialized : Void
    • Let the MovieManager know that the movie is done initializing.
  • kill : Void
    • Method to perform cleaning up before the LocalController gets deleted.
  • start : Void
    • Start the movie.
  • stop : Void
    • Stop the movie.
  • show : Void
    • Show the movie.
  • hide : Void
    • Hide the movie.
  • getName : String
    • Gets the name of the LocalController by which it is uniquely identified.
  • setName (inName:String) : Void
    • Sets the name of the LocalController by which it is uniquely identified.
  • getTimeline : MovieClip
    • Gets the movieclip that this controller controls.
  • isStandalone : Boolean
    • Return whether the movie that the controller controls, is running embedded or standalone.
  • toString : String

Constructor

LocalController

function LocalController (
inTimeline:MovieClip)

Constructor, performs basic initialization, and notifies the MovieManager that the movie has been created.
Gets its name from the MovieManager.
Parameters:
inTimeline:
movieclip that is controlled by the LocalController, usually the timeline reference from where the LocalController is created
Example:
  • On the timeline:
    HistoryController.main(this);

    Inside the class HistoryController:
    class HistoryController extends LocalController {
    
        public function HistoryController (inTimeline:MovieClip) {
            super(inTimeline);
    
            // let MovieManager know initialization is done
            notifyMovieInitialized();
        }
    
        // the main entry point of the application
        public static function main (inTimeline:MovieClip) : Void {
            var controller:HistoryController = new HistoryController(inTimeline);
        }
    
        public function toString() {
            return ";HistoryController";
        }
    }

Instance properties

mName

private mName:String
(read)

Name identifier.

mTimeline

private mTimeline:MovieClip
(read)

Movieclip that is controlled by the LocalController.

Instance methods

getName

function getName (
) : String

Gets the name of the LocalController by which it is uniquely identified.
Returns:
  • The name identifier.

getTimeline

function getTimeline (
) : MovieClip

Gets the movieclip that this controller controls.
Returns:
  • Movieclip

hide

function hide (
) : Void

Hide the movie.
Basic behaviour sets the visibility of the root movieclip to false.
Specific behaviour may be implemented in subclasses.
Specified by:

isStandalone

function isStandalone (
) : Boolean

Return whether the movie that the controller controls, is running embedded or standalone.
Returns:
  • True: the movie is running standalone; false: the movie is running embedded.

kill

function kill (
) : Void

Method to perform cleaning up before the LocalController gets deleted.
Default implementation does nothing.
Specific behaviour may be implemented in subclasses.
Specified by:

notifyMovieInitialized

function notifyMovieInitialized (
) : Void

Let the MovieManager know that the movie is done initializing.
In specific circumstances you may need to wait at least one enterFrame before calling this (for example using org.asapframework.util.FrameDelay).

setName

function setName (
inName:String) : Void

Sets the name of the LocalController by which it is uniquely identified.
Parameters:
inName:
name

show

function show (
) : Void

Show the movie.
Basic behaviour sets visibility of the root movieclip to true.
Specific behaviour may be implemented in subclasses.
Specified by:

start

function start (
) : Void

Start the movie. Usually called from the container when onMovieReady event has been received,
Basic behaviour just shows the movie.
Specific behaviour may be implemented in subclasses.
Specified by:

stop

function stop (
) : Void

Stop the movie. Usually called from the container to tell the movie to go away.
Basic behaviour just hides the movie.
Specific behaviour may be implemented in subclasses.
Specified by:

toString

function toString (
) : String