A convenient controller to play though multiple different movies. Designed for characters and objects that have a separate Flump symbol for each of their animations, and need to switch between them. The played movies will be added to a new child entity of the owner.

Constructor

Properties

read only looping :Bool

Whether the current movie is being looped.

read only movie :Value<MovieSprite>

The movie currently being shown.

Methods

View source

loop (name :String, ?restart :Bool = true) :MoviePlayer

Shows a movie that loops forever.

Parameters:

name

The symbol name of the movie to loop.

restart

If this movie is already being looped, whether it will restart it from the beginning.

Returns:

This instance, for chaining.

View source

play (name :String, ?restart :Bool = true) :MoviePlayer

Shows a movie that plays once. When it completes, the last looping movie is returned to. It is an error to call this without starting a loop() first.

Parameters:

name

The symbol name of the movie to play.

restart

If this movie is already being played, whether it will restart it from the beginning.

Returns:

This instance, for chaining.

View source

setCache (cache :Bool) :MoviePlayer

Configures whether this MoviePlayer will keep a cache of all its MovieSprites, rather than creating a new instance for each play. This makes switching movies faster, at the expense of memory. By default, the cache is enabled. If this MoviePlayer plays lots of different movies, but doesn't switch through them too often, consider disabling the cache.

Returns:

This instance, for chaining.

View source

setDecorator (decorator :MovieSprite -> Void) :MoviePlayer

Configures the callback used to decorate newly created MovieSprites, if any. This can be used to dress up avatars or other custom initialization.

Returns:

This instance, for chaining.

Static properties

View source

static read only NAME :String