Visit SlideShowPro.net  Community Forums
SlideShowPro Support Wiki
  
SlideShowPro Player

Events (AS2)

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.

Quick Index: Loading...

onAlbumData

Broadcast to all registered listeners when an album is loaded. The eventObject contains the following properties:

id
(String) The ID of the current album
description
(String) The description of the current album
lgpath
(String) The lgpath attribute of the current album
tnpath
(String) The tnpath attribute of the current album
title
(String) The title of the current album
tn
(String) The thumbnail file path for the current album
totalImages
(Number) The total number of images in the current album

Example (ActionScript 2)

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);

onAlbumEnd

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.

Example (ActionScript 2)

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);

onDisplayModeChange

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.

Example (ActionScript 2)

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);

onFullScreenChange

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".

Example (ActionScript 2)

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);

onGalleryData

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.

Example (ActionScript 2)

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);

onGalleryInfo

Broadcasted to all registered listeners when gallery data is parsed. The eventObject contains the following properties:

title
(String) The title of the gallery
description
(String) The description of the gallery

Example (ActionScript 2)

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);

onGalleryState

Broadcasted to all registered listeners when the gallery changes position. The eventObject returns one of the following: "open", "opening", "closing", "closed", "hiding" and "hidden".

Example (ActionScript 2)

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);

onImageAlign

Broadcasted to all registered listeners when an image or video is aligned. The eventObject contains the following properties.

w
(Number) The formatted width of slideshow content.
h
(Number) The formatted width of slideshow content.
wo
(Number) The original width of slideshow content.
ho
(Number) The original height of slideshow content.
x
(Number) The x-axis position of slideshow content.
y
(Number) The y-axis position of slideshow content.

Example (ActionScript 2)

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);

onImageClick

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.

Example (ActionScript 2)

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);

onImageData

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:

caption
(String) The caption of the current image
title
(String) The title of the current image
id
(String) The id of the current image
link
(String) The hyperlink of the current image
number
(Number) The image's numerical position
pause
(Number) The imagePause XML override value of the current image
src
(String) The file name of the current image
target
(String) The hyperlink target of the current image
tn
(String) The image's thumbnail URL
vidpreview
(String) The video preview URL

Example (ActionScript 2)

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);

onImageFormat

Broadcasted to all registered listeners when an image or video is formatted. The eventObject contains the following properties:

w
(Number) The formatted width of slideshow content.
h
(Number) The formatted width of slideshow content.
wo
(Number) The original width of slideshow content.
ho
(Number) The original height of slideshow content.
x
(Number) The pre-alignment x-axis position of slideshow content (use onImageAlign for actual placement).
y
(Number) The pre-alignment y-axis position of slideshow content (use onImageAlign for actual placement).

Example (ActionScript 2)

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);

onImageRoll

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.

Example (ActionScript 2)

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);

onImageZone

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.

Example (ActionScript 2)

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);

onLoadXML

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.

Example (ActionScript 2)

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);

onNavButtonDisabled

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.

Example (ActionScript 2)

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);

onNavButtonEnabled

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.

Example (ActionScript 2)

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);

onPermalink

Broadcast when a gallery loads. Returns true if the slideshow was accessed via a permalink URL, false if accessed normally.

Example (ActionScript 2)

The following example traces the value:

listenerObject = new Object();
listenerObject.onPermalink = function():Void {
	trace(eventObject.data);
}
my_ssp.addEventListener("onPermalink", listenerObject);

onPreloadEnd

Broadcast to all registered listeners when a slideshow image has finished loading.

Example (ActionScript 2)

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);

onPreloadInit

Broadcast to all registered listeners when a load request is made.

Example (ActionScript 2)

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);

onPreloadProgress

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.

Example (ActionScript 2)

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);

onTransEffectEnd

Broadcast to all registered listeners when a transition animation effect has completed.

Example (ActionScript 2)

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);

onTransEffectStart

Broadcast to all registered listeners when a transition animation effect begins.

Example (ActionScript 2)

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);

onTransPauseEnd

Broadcast to all registered listeners when transition pause is engaged and the timer begins to countdown.

Example (ActionScript 2)

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);

onTransPauseStart

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).

Example (ActionScript 2)

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);

onVideoCuePoint

Broadcast to all registered listeners when an embedded cue point is reached while playing a video file.

Example (ActionScript 2)

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);

onVideoEnd

Broadcast to all registered listeners when a video ends playback.

Example (ActionScript 2)

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);

onVideoMetaData

Broadcast to all registered listeners when video metadata from a video is parsed. The eventObject contains all of the metadata embedded in the video.

Example (ActionScript 2)

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);

onVideoNetStream

Broadcast to all registered listeners when status information about a video is broadcasted by the onStatus function of the NetStream class.

Example (ActionScript 2)

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);

onVideoPause

Broadcast to all registered listeners when a loaded video pauses.

Example (ActionScript 2)

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);

onVideoPlayBttnRelease

Broadcast to all registered listeners the video preview play button is released.

Example (ActionScript 2)

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);

onVideoPreviewLoad

Broadcast to all registered listeners when a preview image for a video is loaded and displayed.

Example (ActionScript 2)

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);

onVideoPreviewRemove

Broadcast to all registered listeners when a preview image for a video has unloaded and is no longer visible.

Example (ActionScript 2)

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);

onVideoResume

Broadcast to all registered listeners when a loaded video resumes playback.

Example (ActionScript 2)

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);

onVideoStart

Broadcast to all registered listeners when a video begins playback.

Example (ActionScript 2)

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);

onXMLData

Broadcast to all registered listeners after XML data has been parsed. The eventObject contains the actual XML markup.

Example (ActionScript 2)

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);
Quick index:
:
Page last modified by tdominey on November 14, 2010, at 08:52 AM
© 2011 SlideShowPro. All Rights Reserved.