
| Document player compatibility |
|---|
| SlideShowPro Player for Flash (ActionScript 2) |
Events are broadcasted by the SlideShowPro player to communicate noteworthy occurrences like data and content loading, drawing, and behavior. Some events include event object data that can be retrieved and used outside of the SWF.
Broadcast to all registered listeners when an album is loaded. The eventObject contains the following properties:
The following example sends the description of the loaded album to the Output panel:
listenerObject = new Object();
listenerObject.onAlbumData = function(eventObject):Void {
trace(eventObject.data.description);
}
my_ssp.addEventListener("onAlbumData", listenerObject);
Broadcasted to all registered listeners when the final image in an album has been displayed and the SlideShowPro Player engages Auto Finish Mode to decide what to do next.
The following example sends an alert to the Output panel that the current album has ended:
listenerObject = new Object();
listenerObject.onAlbumEnd = function():Void {
trace("Album end reached.");
}
my_ssp.addEventListener("onAlbumEnd", listenerObject);
Broadcasted to all registered listeners when the Display Mode parameter changes. The event object returns the strings "Auto" or "Manual" to indicate which mode it has changed to.
The following example traces Display Mode to the Output panel each time it changes:
listenerObject = new Object();
listenerObject.onDisplayModeChange = function(eventObject):Void {
if (eventObject.data=="Auto") {
trace("Auto mode enabled");
} else if (eventObject.data=="Manual") {
trace("Manual mode enabled");
}
}
my_ssp.addEventListener("onDisplayModeChange", listenerObject);
Broadcasted to all registered listeners when the SlideShowPro Player enters and exits full screen mode in Flash Player 9. Event object contains the strings "fullScreen" or "normal".
The following example shows how to detect changes in full screen mode:
listenerObject = new Object();
listenerObject.onFullScreenChange = function(eventObject):Void {
if (eventObject.data == "fullScreen") {
// insert code here
} else if (eventObject.data == "normal") {
// insert code here
}
}
my_ssp.addEventListener("onFullScreenChange", listenerObject);
Broadcast to all registered listeners when the XML data has successfully parsed into an array. The eventObject contains the following multidimensional array:
[[albumObject,[imageObjectArray]]]
Each albumObject contains the same properties delivered by the onAlbumData event object, while the imageObjectArray is an array of image objects containing the same properties delivered by the onImageData event object.
The following example traces the title of the third album to the Output panel:
listenerObject = new Object();
listenerObject.onGalleryData = function(eventObject):Void {
trace(eventObject.data[2][0].title);
}
my_ssp.addEventListener("onGalleryData", listenerObject);
The following example traces the number of images in the third album to the Output panel:
listenerObject = new Object();
listenerObject.onGalleryData = function(eventObject):Void {
trace(eventObject.data[2][1].length);
}
my_ssp.addEventListener("onGalleryData", listenerObject);
The following example traces the caption of the fifth image in the third album to the Output panel:
listenerObject = new Object();
listenerObject.onGalleryData = function(eventObject):Void {
trace(eventObject.data[2][1][4].caption);
}
my_ssp.addEventListener("onGalleryData", listenerObject);
Broadcasted to all registered listeners when gallery data is parsed. The eventObject contains the following properties:
The following example sends the title of the gallery to the Output panel:
listenerObject = new Object();
listenerObject.onGalleryInfo = function(eventObject):Void {
trace(eventObject.data.title);
}
my_ssp.addEventListener("onGalleryInfo", listenerObject);
Broadcasted to all registered listeners when the gallery changes position. The eventObject returns one of the following: "open", "opening", "closing", "closed", "hiding" and "hidden".
The following example traces the state of the gallery:
listenerObject = new Object();
listenerObject.onGalleryState = function(eventObject):Void {
if (eventObject.data=="open") {
trace("gallery is open");
} else if (eventObject.data=="closed") {
trace("gallery is closed");
} else if (eventObject.data=="hidden") {
trace("gallery is hidden");
}
}
my_ssp.addEventListener("onGalleryState", listenerObject);
Broadcasted to all registered listeners when an image or video is aligned. The eventObject contains the following properties.
The following example publishes the alignment to the Output panel:
listenerObject = new Object();
listenerObject.onImageAlign = function(eventObject):Void {
trace("xpos=" + eventObject.data.x + " ypos=" + eventObject.data.y);
}
my_ssp.addEventListener("onImageAlign", listenerObject);
Broadcasted to all registered listeners when a mouse clicks inside the content area. The eventObject contains the content area "zone" that was clicked. Returns "previous", "action" or "next".
"previous" is dispatched when the mouse clicks on the left side of the content area, and "next" when the mouse clicks on the right. Both of these are only broadcasted when contentAreaInteractivity is set to "Action Area and Navigation". "action" is dispatched when the mouse clicks the center area, and is broadcasted in both "Action Area and Navigation" and "Action Area Only" settings for contentAreaInteractivity.
The following example traces to the Output panel which zone was clicked:
listenerObject = new Object();
listenerObject.onImageClick = function(eventObject):Void {
trace(eventObject.data);
}
my_ssp.addEventListener("onImageClick", listenerObject);
Broadcast to all registered listeners when an image is loaded.
The eventObject contains all img attributes (and their values) from the XML data loaded by the SlideShowPro player. Because the object is created automatically, you can include additional (non-supported) attributes if you have additional data you wish to use. "Supported" attributes (ones used by the component) include:
The following example sends the caption of the loaded image to the Output panel:
listenerObject = new Object();
listenerObject.onImageData = function(eventObject):Void {
trace(eventObject.data.caption);
}
my_ssp.addEventListener("onImageData", listenerObject);
Broadcasted to all registered listeners when an image or video is formatted. The eventObject contains the following properties:
The following example publishes the formatted width and height to the Output panel:
listenerObject = new Object();
listenerObject.onImageFormat = function(eventObject):Void {
trace("Width=" + eventObject.data.w + " Height=" + eventObject.data.h);
}
my_ssp.addEventListener("onImageFormat", listenerObject);
Broadcasted to all registered listeners when a mouse pointer passes in and out of a loaded image's area. The eventObject returns the string "over" when the pointer has rolled-over an image, and "out" when rolled-out.
The following example sends an alert to the Output window when the mouse has rolled-over and rolled-out of an image:
listenerObject = new Object();
listenerObject.onImageRoll = function(eventObject):Void {
if (eventObject.data=="over") {
trace("Mouse over");
} else if (eventObject.data=="out") {
trace("Mouse out");
}
}
my_ssp.addEventListener("onImageRoll", listenerObject);
Broadcasted to all registered listeners when a mouse hovers over the content area. The eventObject contains the content area "zone" that is being hovered over. Returns "previous", "action" or "next".
"previous" is dispatched when the mouse hovers over the left side of the content area, and "next" when the mouse hovers over the right. Both of these are only broadcasted when contentAreaInteractivity is set to "Action Area and Navigation". "action" is dispatched when the mouse hovers over the center area, and is broadcasted in both "Action Area and Navigation" and "Action Area Only" settings for contentAreaInteractivity.
The following example traces to the Output panel which zone is being hovered over:
listenerObject = new Object();
listenerObject.onImageZone = function(eventObject):Void {
trace(eventObject.data);
}
my_ssp.addEventListener("onImageZone", listenerObject);
Broadcasted to all registered listeners when an XML file is loaded. The eventObject contains a Boolean property (false, true) to indicate whether an XML file was found.
The following example sends an error message to the Output panel if an XML file was not found:
listenerObject = new Object();
listenerObject.onLoadXML = function(eventObject):Void {
if (eventObject.data == false) {
trace("XML file not found");
}
}
my_ssp.addEventListener("onLoadXML", listenerObject);
Broadcast to all registered listeners when the forward or back navigation buttons have been disabled. The eventObject contains the strings "previous" (the minus button) and/or "next" (the plus button) to indicate which button was disabled.
The following example traces which button was disabled to the Output window:
listenerObject = new Object();
listenerObject.onNavButtonDisabled = function(eventObject):Void {
if (eventObject.data=="previous") {
trace("previous button disabled");
} else if (eventObject.data=="next") {
trace("next button disabled");
}
}
my_ssp.addEventListener("onNavButtonDisabled", listenerObject);
Broadcast to all registered listeners when the forward or back navigation buttons have been enabled. The eventObject contains the strings "previous" (the minus button) and/or "next" (the plus button) to indicate which button was enabled.
The following example traces which button was enabled to the Output window:
listenerObject = new Object();
listenerObject.onNavButtonEnabled = function(eventObject):Void {
if (eventObject.data=="previous") {
trace("previous button enabled");
} else if (eventObject.data=="next") {
trace("next button enabled");
}
}
my_ssp.addEventListener("onNavButtonEnabled", listenerObject);
Broadcast when a gallery loads. Returns true if the slideshow was accessed via a permalink URL, false if accessed normally.
The following example traces the value:
listenerObject = new Object();
listenerObject.onPermalink = function():Void {
trace(eventObject.data);
}
my_ssp.addEventListener("onPermalink", listenerObject);
Broadcast to all registered listeners when a slideshow image has finished loading.
The following example sends a message to the Output panel when each slideshow asset has fully loaded:
listenerObject = new Object();
listenerObject.onPreloadEnd = function():Void {
trace("Image loaded");
}
my_ssp.addEventListener("onPreloadEnd", listenerObject);
Broadcast to all registered listeners when a load request is made.
The following example traces a message to the output panel when a load request has been made:
listenerObject = new Object();
listenerObject.onPreloadInit = function():Void {
trace("preload initiated");
}
my_ssp.addEventListener("onPreloadInit", listenerObject);
Continuously broadcasted to all registered listeners when the percentage of data being preloaded is updated. Event fires after onPreloadInit and before onPreloadEnd. The eventObject returns only numbers from 0 to 100.
The following example traces the percentage of data that has loaded as part of the preload request:
listenerObject = new Object();
listenerObject.onPreloadProgress = function(eventObject):Void {
trace("loaded: " + eventObject.data);
}
my_ssp.addEventListener("onPreloadProgress", listenerObject);
Broadcast to all registered listeners when a transition animation effect has completed.
The following example writes confirmation to the Output panel each time a transition animation finishes:
listenerObject = new Object();
listenerObject.onTransEffectEnd = function():Void {
trace("Transition complete");
}
my_ssp.addEventListener("onTransEffectEnd", listenerObject);
Broadcast to all registered listeners when a transition animation effect begins.
The following example writes confirmation to the Output panel each time a transition animation starts:
listenerObject = new Object();
listenerObject.onTransEffectStart = function():Void {
trace("Transition starting");
}
my_ssp.addEventListener("onTransEffectStart", listenerObject);
Broadcast to all registered listeners when transition pause is engaged and the timer begins to countdown.
The following example writes to the Output panel when transition pause has finished counting down:
listenerObject = new Object();
listenerObject.onTransPauseEnd = function():Void {
trace("Pause is complete");
}
my_ssp.addEventListener("onTransPauseEnd", listenerObject);
Broadcast to all registered listeners when transition pause is engaged and the timer begins to countdown. The eventObject contains the length of the pause (in seconds).
The following example writes to the Output panel the number of seconds the current pause will last:
listenerObject = new Object();
listenerObject.onTransPauseStart = function(eventObject):Void {
trace("We're going to sit here for " + eventObject.data + " seconds.")
}
my_ssp.addEventListener("onTransPauseStart", listenerObject);
Broadcast to all registered listeners when an embedded cue point is reached while playing a video file.
The following example traces the cue point event object data:
listenerObject = new Object();
listenerObject.onVideoCuePoint = function(eventObject):Void {
for (var prop in eventObject.data) {
trace(prop + ": " + eventObject.data[prop]);
}
}
my_ssp.addEventListener("onVideoCuePoint", listenerObject);
Broadcast to all registered listeners when a video ends playback.
The following traces a confirmation message to the Output panel when the video completes:
listenerObject = new Object();
listenerObject.onVideoEnd = function():Void {
trace("Video has ended");
}
my_ssp.addEventListener("onVideoEnd", listenerObject);
Broadcast to all registered listeners when video metadata from a video is parsed. The eventObject contains all of the metadata embedded in the video.
The following example reads the video metadata broadcasted by the SlideShowPro player and traces each property and value to the Output panel:
listenerObject = new Object();
listenerObject.onVideoMetaData = function(eventObject):Void {
for (var prop in eventObject.data) {
trace(prop + ": " + eventObject.data[prop]);
}
}
my_ssp.addEventListener("onVideoMetaData", listenerObject);
Broadcast to all registered listeners when status information about a video is broadcasted by the onStatus function of the NetStream class.
The following example traces any status updates that are broadcasted when a video is loaded.
listenerObject = new Object();
listenerObject.onVideoNetStream = function(eventObject):Void {
trace(eventObject.data);
}
my_ssp.addEventListener("onVideoNetStream", listenerObject);
Broadcast to all registered listeners when a loaded video pauses.
The following example sends a trace message to the Output panel when video playback pauses:
listenerObject = new Object();
listenerObject.onVideoPause = function(eventObject):Void {
trace("playback of video has paused")
}
my_ssp.addEventListener("onVideoPause", listenerObject);
Broadcast to all registered listeners the video preview play button is released.
The following example traces a message to the Output panel when the button is clicked:
listenerObject = new Object();
listenerObject.onVideoPlayBttnRelease = function():Void {
trace("Video preview play button released");
}
my_ssp.addEventListener("onVideoPlayBttnRelease", listenerObject);
Broadcast to all registered listeners when a preview image for a video is loaded and displayed.
The following traces a confirmation message to the Output panel when the video preview image loads:
listenerObject = new Object();
listenerObject.onVideoPreviewLoad = function():Void {
trace("Video preview image has loaded");
}
my_ssp.addEventListener("onVideoPreviewLoad", listenerObject);
Broadcast to all registered listeners when a preview image for a video has unloaded and is no longer visible.
The following traces a confirmation message to the Output panel when the video preview image is removed:
listenerObject = new Object();
listenerObject.onVideoPreviewRemove = function():Void {
trace("Video preview image has been removed");
}
my_ssp.addEventListener("onVideoPreviewRemove", listenerObject);
Broadcast to all registered listeners when a loaded video resumes playback.
The following example sends a trace message to the Output panel when video playback resumes:
listenerObject = new Object();
listenerObject.onVideoResume = function(eventObject):Void {
trace("playback of video has resumed")
}
my_ssp.addEventListener("onVideoResume", listenerObject);
Broadcast to all registered listeners when a video begins playback.
The following example traces a message to the Output panel when playback of a video begins:
listenerObject = new Object();
listenerObject.onVideoStart = function():Void {
trace("Video has started");
}
my_ssp.addEventListener("onVideoStart", listenerObject);
Broadcast to all registered listeners after XML data has been parsed. The eventObject contains the actual XML markup.
The following example traces the XML markup that the SlideShowPro Player loaded to the Output panel:
listenerObject = new Object();
listenerObject.onXMLData = function(eventObject):Void {
trace(eventObject.data);
}
my_ssp.addEventListener("onXMLData", listenerObject);
: