Package | com.dwuser.ss4.core |
Class | public class SlideshowInterface |
This topic no longer contains the most up-to-date information about slideshow / javascript interfacing. For the most up-to-date information, see Slideshow / Javascript Interfacing in the main documentation.
There are two types of calls:
In the code below, image and gallery UniqueID's are referenced. These are automatically assigned identifiers which each image and gallery has based on its position within the gallery and/or the gallery's position within the
slideshow. Gallery UniqueID's have the following format: gallery_0
where the integer represents the gallery's 0-base index within the slideshow. Thus the preceding example represents the first gallery. Image UniqueID's
have the following format: image_0_5
where the first integer represents the gallery's 0-base index within the slideshow, and the second integer represents the image's 0-base index within the gallery. Thus the preceding example
represents the sixth image in the first gallery.
Details on outgoing calls (you define these methods within your page):
Method Name/Signature | Description |
---|---|
XMLFlashSlideshow_v4_getInitialViewID():String | As the slideshow is initializing, this method is called automatically in the host page. If the method is defined and returns a valid string value, the layout view corresponding to this return value will be opened as the initial
view. For example, you might have defined the following view in your Layout XML in the XML configuration file: <script language="javascript"> function XMLFlashSlideshow_v4_getInitialViewID() { return "demoView"; } </script> |
XMLFlashSlideshow_v4_getInitialImage():String | Before the slideshow automatically opens the initial gallery, this method is called automatically in the host page. It allows you to override which gallery and image is displayed initially. If the method is defined and returns a valid image UniqueID value, the image corresponding to the returned UniqueID will be opened. For example, the following javascript code block in your HTML page would make the third image in the first gallery open initially: <script language="javascript"> function XMLFlashSlideshow_v4_getInitialImage() { return "img_0_2"; } </script> |
XMLFlashSlideshow_v4_notifyReadyForImageSet():void | This method is automatically called in the host page once the slideshow has initialized to the point of being ready to accept incoming calls. See the table below for more information on incoming calls, which allow your scripts to control the slideshow. For example, the following javascript code block could be placed in your HTML page: <script language="javascript"> function XMLFlashSlideshow_v4_notifyReadyForImageSet() { // This method doesn't return anything... alert('The slideshow says it is ready for incoming calls!'); } </script> |
XMLFlashSlideshow_v4_syncGallery(uniqid:String):void | This method is automatically called in the host page whenever a gallery is opened. It allows your page to track the current gallery that is open in the slideshow. You could use this to display pertinent gallery-related information in the HTML page. For example, the following javascript code block could be placed in your HTML page to display an alert every time a new gallery is opened: <script language="javascript"> function XMLFlashSlideshow_v4_syncGallery(uniqid) { // This method doesn't return anything... alert('The slideshow has just opened a gallery. Here is its UniqueID: ' + uniqid); } </script> |
XMLFlashSlideshow_v4_syncImagesStart(uniqid:String):void | This method is automatically called in the host page whenever an image starts to be opened/synced. It allows your page to track the current image that is open in the slideshow. You could use this to display pertinent image-related information in the HTML page, or to track which image is open and store the state in a cookie, etc. Or, you could use a package such as SWFAddress to enable back/forward button browser navigation. For example, the following javascript code block could be placed in your HTML page to display an alert every time a new image starts to open: <script language="javascript"> function XMLFlashSlideshow_v4_syncImagesStart(uniqid) { // This method doesn't return anything... alert('The slideshow has just started to open a new image. Here is its UniqueID: ' + uniqid); } </script> |
XMLFlashSlideshow_v4_syncImages(uniqid:String):void | This method is automatically called in the host page whenever an image has been opened/synced. It is called shortly after the above <script language="javascript"> function XMLFlashSlideshow_v4_syncImages(uniqid) { // This method doesn't return anything... alert('The slideshow has just opened a new image. Here is its UniqueID: ' + uniqid); } </script> |
Details on incoming calls (you call these methods within your own scripts):
Note: These calls are designed for implementations with only one slideshow on a page. If you need to use javascript interactions with multiple slideshows on a single page, then you need to place each separate slideshow in a different page and display them in the main page using <iframe>'s.
Method Name/Signature | Description |
---|---|
XMLFlashSlideshow_v4_requestGallery(uniqid:String = "gallery_0"):void | This call cannot be made until the XMLFlashSlideshow_v4_notifyReadyForImageSet() outgoing call has been made (see above). Calling this method opens the specific gallery identified by the passed gallery UniqueID. For example, the following snippet (which would need to be placed within some other block of code) would open the second gallery: <script language="javascript"> ... // Open the second gallery XMLFlashSlideshow_v4_requestGallery("gallery_1"); ... </script> |
XMLFlashSlideshow_v4_setImage(uniqid:String = "img_0_5"):void | This call cannot be made until the XMLFlashSlideshow_v4_notifyReadyForImageSet() outgoing call has been made (see above). Calling this method opens the specific image identified by the passed image UniqueID. For example, the following snippet (which would need to be placed within some other block of code) would open the third image in the second gallery: <script language="javascript"> ... // Open the third image in the second gallery XMLFlashSlideshow_v4_setImage("img_1_2"); ... </script> |
Property | Defined by | ||
---|---|---|---|
slideshow : FlashSlideshow
[static]
| SlideshowInterface |
Method | Defined by | ||
---|---|---|---|
SlideshowInterface |
slideshow | property |
slideshow:FlashSlideshow
[read-write]Implementation
public static function get slideshow():FlashSlideshow
public function set slideshow(value:FlashSlideshow):void
SlideshowInterface | () | constructor |
public function SlideshowInterface()