LocalController
| Kind of class: | class |
|---|---|
| Inherits from: | Dispatcher |
| Implements: | |
| Classpath: | org.asapframework.management.movie.LocalController |
| File last modified: | Monday, 06 November 2006, 08:09:15 |
(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
function LocalController (
inTimeline:MovieClip)
Constructor, performs basic initialization, and notifies the MovieManager that the movie has been created.
Gets its name from the MovieManager.
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:
Inside the class HistoryController:
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 methods
getName
function getName (
) : String
Gets the name of the LocalController by which it is uniquely identified.
Returns:
The name identifier.
Specified by:
getTimeline
function getTimeline (
) : MovieClip
Gets the movieclip that this controller controls. Can also be retrieved with #timeline.
Returns:
Movieclip
Specified by:
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.
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.
Specified by:
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.
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).
In specific circumstances you may need to wait at least one enterFrame before calling this (for example using org.asapframework.util.FrameDelay).
Specified by:
setName
function setName (
inName:String) : Void
Sets the name of the LocalController by which it is uniquely identified.
Parameters:
inName:
name
Specified by:
show
function show (
) : Void
Show the movie.
Basic behaviour sets visibility of the root movieclip to true.
Specific behaviour may be implemented in subclasses.
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.
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.
Basic behaviour just hides the movie.
Specific behaviour may be implemented in subclasses.
Specified by:
toString
function toString (
) : String