PackageTop Level
Classpublic class openc_swfslideshow
Inheritanceopenc_swfslideshow Inheritance flash.display.Sprite

This movie parses a config file and plays through a series of swf movies with configurable alpha and brightness transitions between each one.



Protected Properties
 PropertyDefined by
  config : Object
A store for configuration after parsing conifg.xml
openc_swfslideshow
  loadingAnimation : MovieClipLoaderAsset
Loading nimation
openc_swfslideshow
  loadingAnimationRaw : Class
Loading animation raw emed
openc_swfslideshow
  movieConfigs : Array
Movies array, hold movie XML elements from config in play order
openc_swfslideshow
  movies : DisplayObjectContainer
Movies container
openc_swfslideshow
  RESOURCES_DIRECTORY : String = "../resources/opensite"
The directory from which to load config.xml
openc_swfslideshow
Public Methods
 MethodDefined by
  
Constructor.
openc_swfslideshow
Protected Methods
 MethodDefined by
  
applyTransitions(slide:MovieClip):void
Apply transitions based on configuration settings and current frame
openc_swfslideshow
  
handleSlideEnterFrame(e:Event):void
Slide enter frame handler.
openc_swfslideshow
  
handleXMLLoadComplete(event:Event):void
Config has loaded.
openc_swfslideshow
  
Sets default configuration options.
openc_swfslideshow
  
loadMovie(movie:XML, isFirstMovie:Boolean = false):void
Load movie
openc_swfslideshow
  
movieClickHandler(movie:MovieClip):void
Movie was clicked
openc_swfslideshow
  
movieLoaded(event:Event, movieConfig:XML):void
A movie has loaded, add it at the bottom of the movies stack.
openc_swfslideshow
  
playSlideInMovie(movie:MovieClip):void
Start a slide playing and attach enterFrame handler.
openc_swfslideshow
Property detail
configproperty
protected var config:Object

A store for configuration after parsing conifg.xml

loadingAnimationproperty 
protected var loadingAnimation:MovieClipLoaderAsset

Loading nimation

loadingAnimationRawproperty 
protected var loadingAnimationRaw:Class

Loading animation raw emed

movieConfigsproperty 
protected var movieConfigs:Array

Movies array, hold movie XML elements from config in play order

moviesproperty 
protected var movies:DisplayObjectContainer

Movies container

RESOURCES_DIRECTORYproperty 
protected var RESOURCES_DIRECTORY:String = "../resources/opensite"

The directory from which to load config.xml

Constructor detail
openc_swfslideshow()constructor
public function openc_swfslideshow()

Constructor. Sets stage scale mode. Sets default configuration values. Looks for a query-string parameter 'resourcesDirectory', if present, overrides RESOURCES_DIRECTORY. Loads config.xml and sets handler

See also

Method detail
applyTransitions()method
protected function applyTransitions(slide:MovieClip):void

Apply transitions based on configuration settings and current frame

Parameters
slide:MovieClip
handleSlideEnterFrame()method 
protected function handleSlideEnterFrame(e:Event):void

Slide enter frame handler. Rewind if this slide has not fully loaded. Fade alpha or brightness if config says it should be fading. Play the next slide down in the stack when either this slide has finished, or the next is configured to play with an overlap. Remove handler when stopped.

Parameters
e:Event
handleXMLLoadComplete()method 
protected function handleXMLLoadComplete(event:Event):void

Config has loaded. Override any specified configuration. Load movies and set handlers.

Parameters
event:Event — Event.COMPLETE fired when config.xml has loaded
initialiseConfig()method 
protected function initialiseConfig():void

Sets default configuration options. Strangely, this needs to be in a different frame to that which loads the XML

loadMovie()method 
protected function loadMovie(movie:XML, isFirstMovie:Boolean = false):void

Load movie

Parameters
movie:XML
 
isFirstMovie:Boolean (default = false)
movieClickHandler()method 
protected function movieClickHandler(movie:MovieClip):void

Movie was clicked

Parameters
movie:MovieClip
movieLoaded()method 
protected function movieLoaded(event:Event, movieConfig:XML):void

A movie has loaded, add it at the bottom of the movies stack. If it's the first, play it. If is a next, load it.

Parameters
event:Event
 
movieConfig:XML
playSlideInMovie()method 
protected function playSlideInMovie(movie:MovieClip):void

Start a slide playing and attach enterFrame handler.

Parameters
movie:MovieClip — the index of the movie within movies stack

See also