AutoSlideShow

Kind of class: public class
Package:
Inherits from:
  • none
Version: 6 Mar 2010
Author: John Polacek, john@johnpolacek.com
Classpath: com.johnpolacek.animation.AutoSlideShow
File last modified: Thursday, 24 February 2011, 22:09:57
AutoSlideShow creates a sequenced, looping animation of all the children of a target Sprite.
Example

  • Basic usage:
    import com.johnpolacek.animation.AutoSlideShow;
    var slideshow:AutoSlideShow = new AutoSlideShow();
    slideshow.start(example_mc);
    
    Example using ImageStack class to load external images, and then animating with the FLY_IN_RANDOM transition style (see Constants):
    import com.johnpolacek.animation.AutoSlideShow;
    import com.johnpolacek.media.ImageStack;
    var slideshow:AutoSlideShow = new AutoSlideShow();
    var stack:ImageStack = new ImageStack("images/image1.jpg",
                                     "images/image2.jpg", 
                                     "images/image3.jpg", 
                                     "images/image4.jpg");
    stack.addEventListener(Event.COMPLETE, onStackComplete);
    function onStackComplete(event:Event):void
    {
    addChild(stack);
    slideshow.start(stack, AutoSlideShow.FLY_IN_RANDOM);
    }
    

Summary

Constants
Instance properties
  • slideDuration : Number
    • Duration that each slide stays on screen, in seconds.
  • transitionSpeed : Number
    • Duration of the slide transition, in seconds.
Instance methods
  • start (target:Sprite, style = DEFAULT_TRANSITION, dur = 3, speed = .5) : void
    • Begins slideshow animation
  • stop () : void
    • Ends slideshow animation

Constants

CROSS_FADE

static const CROSS_FADE:String = "crossFade"

DEFAULT_TRANSITION

static const DEFAULT_TRANSITION:String = CROSS_FADE

FLY_IN_BOTTOM

static const FLY_IN_BOTTOM:String = "flyInBottom"

FLY_IN_LEFT

static const FLY_IN_LEFT:String = "flyInLeft"

FLY_IN_RANDOM

static const FLY_IN_RANDOM:String = "flyInRandom"

FLY_IN_RIGHT

static const FLY_IN_RIGHT:String = "flyInRight"

FLY_IN_TOP

static const FLY_IN_TOP:String = "flyInTop"

Instance properties

slideDuration

slideDuration:Number = 3(read,write)

Duration that each slide stays on screen, in seconds.

transitionSpeed

transitionSpeed:Number = .5(read,write)

Duration of the slide transition, in seconds.

Instance methods

start

function start(target:Sprite, style = DEFAULT_TRANSITION, dur = 3, speed = .5) : void

Begins slideshow animation

Parameters
 

stop

function stop() : void

Ends slideshow animation