Package | com.dwuser.ss4.managers |
Class | public class AutoplayManager |
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:
stop
- Designed to be used on an <img>
node; this autoplayDelay
immediately pauses autoplay when the item is reached.jump
- Designed to be used on an <img>
node; this autoplayDelay
causes the entire page to immediately reload and jump to the Image Link which has been defined
for the image (in the XML, this is the <img ... link="somewhere.htm" ... />
value). This is designed, for example, to allow the slideshow to automatically redirect once the last slide is reached.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:
4000
(any numeric value in milliseconds) - Tells the slideshow to wait for N milliseconds before progressing to the next image.kbComplete
- Tells the slideshow to wait for any KB effect which exists on the image to complete before progressing to the next image.videoComplete
- Tells the slideshow to wait for any video which exists on the image to complete before progressing to the next image.kbComplete
- Tells the slideshow to wait for any audio which has been added to the image to complete before progressing to the next image.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
Property | Defined 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 |
Method | Defined by | ||
---|---|---|---|
AutoplayManager |
autoplayEnabled | property |
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.
loopEnabled | property |
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.
overriddenAutoplayTimeoutDelay | property |
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
AutoplayManager | () | constructor |