Packagecom.dwuser.ss4.managers
Classpublic class AutoplayManager

The AutoplayManager class functions as a central manager for autoplay within a slideshow. A single instance of the class is created for the slideshow and is accessible by referencing the FlashSlideshow_instance.autoplayManager property.

There are several helpful static utility variables which can be accessed on this class.

XML Integration Information

For reference, here is the basic structure of the portion of the XML configuration file which is relevant to this discussion:

   <slideshow>
      ...
      <galleries ... >
         <gallery ... >
            <img ... />
            ...
            More <img> nodes defined here
            ...
         </gallery>
         ...
         More <gallery> nodes defined here
         ...
      </galleries>
      ...
   </slideshow>
   

The initial status of the autoplay is determined by the autoplay and autoplayLoop attributes on the <galleries> node:

   <galleries ... autoplay="true|false" autoplayLoop="true|false">
   

If autoplay is set to true, autoplay will be enabled when the slideshow starts.

Autoplay looping - If autoplayLoop is set to true above (on the galleries node), global autoplay looping will be enabled. Global autoplay looping means that the slideshow will return to the first image in the first gallery once the last image in the last gallery has been reached. If autoplayLoop is set to true on an individual <gallery> node, autoplay will automatically return to the first image in that gallery once the last image has been reached, instead of jumping to the next gallery.

Randomization - To enable random playback of a gallery or all galleries, add this attribute to either the <galleries> node or an individual <gallery> node: <gallery|galleries ... randomize="true">

About autoplayDelay String Structure / Determining the Autoplay Delay

To determine the delay between images, to disable autoplay on a specific image, or to automatically jump to a URL when an image is reached, you will modify the autoplayDelay attribute.

First, it's important to note the inheritance structure. When an image is opened, first the corresponding <img ... /> node is checked for an autoplayDelay value. If one exists, it is used. Otherwise, the AutoplayManager next looks on the image's parent <gallery> node. If still none is found, it looks on the main <galleries> node. Thus, you can establish a default for all galleries or one specific gallery, while at the same time customizing the autoplayDelay on specific images as needed. Essentially, it just looks up the image's XML family tree for the first defined autoplayDelay attribute.

There are three different supported autoplayDelay formats:

The comma-separated list format:

When you use the comma-separated list format, you'll construct a string with one or more of the following values in order of priority:

For example, if you wanted to always have a delay of 6 seconds between each slide, you'd use an autoplay delay of: 6000 . Suppose you had a narration attached to one of your images, and you wanted that slide to play the full narration before progressing. In this case, you'd use an autoplayDelay of: audioComplete,6000 . This delay says essentially, "If there's audio on the slide, wait for it to complete before progressing. Otherwise, progress after six seconds."

As a more complex example, suppose you had video on some slides, audio on other slides, and some KB effects alongside some of the audio. Because the audio is more important than the KB pan/zoom effect, it should always take priority. That is to say, the audio should be allowed to complete, even if the KB effect has already finished. So, you would want to use an autoplayDelay value of: audioComplete,videoComplete,kbComplete,6000 . This delay says essentially, "If there's audio on the slide, wait for it to complete before progressing. If there's no audio but there is video, wait for the video to complete before progressing. If there's neither audio nor video but there is a KB effect, wait for the KB effect to complete before progressing. If there's no audio, video, nor KB effect, wait for six seconds before progressing."

Examples of specifying a global autoplayDelay, a gallery-specific autoplayDelay, and an image-specific autoplayDelay:

   // Global
   <galleries ... autoplayDelay="videoComplete,audioComplete,5000">
  
   // Gallery-specific
   <gallery ... autoplayDelay="kbComplete,6000">
  
   // Image-specific - either when the KB effect ends, or 8 secs if no KB effect exists
   <img ... autoplayDelay="kbComplete,8000">
  
   // Image-specific - stops autoplay when the image is reached
   <img ... autoplayDelay="stop">
  
   // Image-specific - jumps to google when the image is reached
   <img ... link="http://www.google.com/" autoplayDelay="jump">
   

See also

com.dwuser.ss4.ui.FlashSlideshow


Public Properties
 PropertyDefined by
  autoplayEnabled : Boolean
[static] This static utility variable tracks whether autoplay is currently enabled (playing) or disabled (paused).
AutoplayManager
  loopEnabled : Boolean
[static] This static utility variable tracks whether global autoplay looping is currently enabled or disabled.
AutoplayManager
  overriddenAutoplayTimeoutDelay : Number = NaN
[static] Optionally specifies an explicitly overridden autoplay timeout delay, in milliseconds, to use.
AutoplayManager
Public Methods
 MethodDefined by
  
AutoplayManager
Property detail
autoplayEnabledproperty
public static var autoplayEnabled:Boolean

This static utility variable tracks whether autoplay is currently enabled (playing) or disabled (paused).

This property can be used as the source for data binding.

loopEnabledproperty 
public static var loopEnabled:Boolean

This static utility variable tracks whether global autoplay looping is currently enabled or disabled. Global autoplay looping allows for an automatic jump from the last image in the last gallery to the first image in the first gallery.

This property can be used as the source for data binding.

overriddenAutoplayTimeoutDelayproperty 
public static var overriddenAutoplayTimeoutDelay:Number = NaN

Optionally specifies an explicitly overridden autoplay timeout delay, in milliseconds, to use. This value can be set by various UI elements, such as the AutoplayDelaySlider element. If the variable is set to a numeric value, the autoplay timer it will use this value whenever it is set.

The default value is NaN, which indicates that no override value exists.

This property can be used as the source for data binding.

See also

Constructor detail
AutoplayManager()constructor
public function AutoplayManager(ss:FlashSlideshow)Parameters
ss:FlashSlideshow