Flash Presentation ActionScript 3 API Reference

Solid and compound Flash presentations generated with iSpring expose an ActionScript 3 API, a set of ActionScript 3 classes and interfaces allowing programmatic access to the Flash presentation:

A Flash application can load an iSpring generated presentation using the flash.display.Loader class. To access the presentation API, the SWF file must be loaded in the new application domain derived from the current application domain. Though it is also possible to load a presentation in the current application domain, it is not recommended since it may cause class and interface definition collisions when loading multiple presentations created with different versions of iSpring.

The properties and methods of the loaded SWF file become ready to use as soon as the init event is dispatched by the contentLoaderInfo property of the Loader object. To determine whether the loaded SWF file is an iSpring generated presentation it is necessary to check whether the content property of the LoaderInfo object implements the ispring.presenter.IPresentationPlayerContainer interface.

iSpring generated Flash presentations support progressive downloading which means that they start playing as soon as the minimum required amount of data (the player and the first presentation slide) has been downloaded. To determine whether the presentation player is loaded and accessible via the player property use the playerIsAvailable property on the IPresentationPlayerContainer interface. The presentation container dispatches the ispring.presenter.PlayerContainerEvent.PLAYER_IS_AVAILABLE event to notify its listeners that the player is accessible.

Flash Presentation ActionScript 3 API interfaces and classes are shown in the following diagram.

Figure 1. Flash Presentation ActionScript 3 API diagram

The following example illustrates how to load an iSpring generated presentation and access its IPresentationPlayer interface.

import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.events.Event;
import flash.net.URLRequest;
import flash.system.ApplicationDomain;
import flash.system.LoaderContext;
import ispring.presenter.IPresentationPlayer;
import ispring.presenter.IPresentationPlayerContainer;
import ispring.presenter.PlayerContainerEvent;

// It is necessary to load the presentation in the derived application domain // in order to access the presentation API
var presentationDomain:ApplicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);

var loader:Loader = new Loader();
var info:LoaderInfo = loader.contentLoaderInfo;
// The Presentation API is accessible only after the Event.INIT event is dispatched
info.addEventListener(Event.INIT, onInit);
// Load the presentation
loader.load(new URLRequest("presentation.swf"), new LoaderContext(false, presentationDomain));

function onInit(evt:Event):void
{
    // Check whether the loaded SWF file is an iSpring generated presentation
    var pc:IPresentationPlayerContainer = info.content as IPresentationPlayerContainer;
    if (pc != null)
    {
        if (pc.playerIsAvailable)
        {
            doSomethingWithThePlayer(pc.player)
        }
        else
        {
            // The player has not been loaded yet, so we need to 
            // wait for the PlayerContainerEvent.PLAYER_IS_AVAILABLE event
            pc.addEventListener(PlayerContainerEvent.PLAYER_IS_AVAILABLE, onPlayerAvailable);s
            function onPlayerAvailable(evt:PlayerContainerEvent):void
            {
                doSomethingWithThePlayer(pc.player);
            }
        }
    }
    else // The SWF file is not an iSpring generated presentation
    {
    }
}

function doSomethingWithThePlayer(player:IPresentationPlayer):void
{
    // Now we can access the presentation player methods and properties
    trace("Presentation title is:", player.presentation.title);
}

The following table lists all interfaces and classes of the Flash Presentation ActionScript 3 API.

Class/Interface Package
ActionType ispring.presenter.presentation.settings
AssetEvent ispring.utils.assets
AssetState ispring.utils.assets
IAnimationStep ispring.presenter.presentation.slides
IAnimationSteps ispring.presenter.presentation.slides
IAsset ispring.utils.assets
IAudioPlaybackControllerFactory ispring.presenter.player.audio
IAudioTrack ispring.presenter.presentation.narration
IAudioTracks ispring.presenter.presentation.narration
ICompany ispring.presenter.presentation
IControlKey ispring.presenter.presentation.settings
IControlKeys ispring.presenter.presentation.settings
IFullScreenManager ispring.presenter.player
IGraphicAsset ispring.utils.assets
IHyperlinkManager ispring.presenter.player.core
IInteraction ispring.interaction
IInteractionAsset ispring.presenter.presentation.resources.interactions
IInteractionAssets ispring.presenter.presentation.resources.interactions
IInteractionWindow ispring.interaction.ui
IKeyboardController ispring.presenter.player
IKeyboardSettings ispring.presenter.presentation.settings
IMediaPlaybackController ispring.presenter.player.media
IMetaCommand ispring.presenter.presentation.meta
IMetaCommands ispring.presenter.presentation.meta
IMouseSettings ispring.presenter.presentation.settings
INarration ispring.presenter.presentation.narration
INarrationTrack ispring.presenter.presentation.narration
INarrationTracks ispring.presenter.presentation.narration
INavigationSettings ispring.presenter.presentation.settings
InteractionEvent ispring.interaction
IPlaybackAction ispring.presenter.presentation.settings
IPlaybackSettings ispring.presenter.presentation.settings
IPresentation ispring.presenter.presentation
IPresentationClock ispring.presenter.player.clock
IPresentationClock2 ispring.presenter.player.clock
IPresentationLoader ispring.presenter.player
IPresentationPlaybackController ispring.presenter.player
IPresentationPlaybackController2 ispring.presenter.player
IPresentationPlaybackCore ispring.presenter.player.core
IPresentationPlayer ispring.presenter
IPresentationPlayerContainer ispring.presenter
IPresentationSlideView ispring.presenter.player.slides
IPresentationStartup ispring.presenter.player.startup
IPresentationView ispring.presenter.player
IPresentationView2 ispring.presenter.player
IPresenter ispring.presenter.presentation
IPresenter2 ispring.presenter.presentation
IPresenters ispring.presenter.presentation
IReference ispring.presenter.presentation.resources.references
IReferences ispring.presenter.presentation.resources.references
IResources ispring.presenter.presentation.resources
ISettings ispring.presenter.presentation.settings
ISkin ispring.presenter.player.skin
ISkinFactory ispring.presenter.player.skin
ISkinWindow ispring.presenter.player.skin.ui
ISlide ispring.presenter.presentation.slides
ISlide2 ispring.presenter.presentation.slides
ISlide3 ispring.presenter.presentation.slides
ISlideChangeRestriction ispring.presenter.player.restriction
ISlideNotes ispring.presenter.presentation.slides
ISlidePlaybackController ispring.presenter.player.slides
ISlides ispring.presenter.presentation.slides
ISlides2 ispring.presenter.presentation.slides
ISlideShow ispring.presenter.presentation
ISlideShows ispring.presenter.presentation
ISlideShowTransition ispring.presenter.presentation.slides
ISlideTransitionController ispring.presenter.player.transitions
ISlideView ispring.presenter.player.slides
ISound ispring.utils.sound
ISoundAsset ispring.utils.assets
ISoundChannel ispring.utils.sound
ISoundController ispring.presenter.player.sound
ITimestamp ispring.presenter.presentation
IVideoNarrationPlayer ispring.presenter.player.video
IVideoPlaybackControllerFactory ispring.presenter.player.video
IVideoPlaybackControllerFactory2 ispring.presenter.player.video
IVideoResolution ispring.presenter.player.video
IVideoTrack ispring.presenter.presentation.narration
IVideoTracks ispring.presenter.presentation.narration
IVideoView ispring.presenter.player.video
IWebLink ispring.presenter.presentation.settings
IWebLinks ispring.presenter.presentation.settings
IWebObject ispring.presenter.presentation.webobjects
IWebObjects ispring.presenter.presentation.webobjects
MediaPlaybackEvent ispring.presenter.player.media
MediaPlaybackEvent2 ispring.presenter.player.media
MetaCommandEvent ispring.presenter.player.events
PlaybackState ispring.presenter.player.media
PlayerContainerEvent ispring.presenter
PresentationClockEvent ispring.presenter.player.clock
PresentationClockEvent2 ispring.presenter.player.clock
PresentationClockState ispring.presenter.player.clock
PresentationClockState2 ispring.presenter.player.clock
PresentationLoaderEvent ispring.presenter.player.events
PresentationPlaybackEvent ispring.presenter.player.events
PresentationPlaybackState ispring.presenter.player
PresentationStartupAction ispring.presenter.player.startup
PresentationStartupEvent ispring.presenter.player.events
ReferenceType ispring.presenter.presentation.resources.references
RestrictedPresentationPlaybackEvent ispring.presenter.player.events
RestrictedPresentationPlaybackEvent2 ispring.presenter.player.events
SkinEvent ispring.presenter.player.skin
SlideChangeRestrictionType ispring.presenter.player.restriction
SlidePlaybackEvent ispring.presenter.presentation.slides
SlideState ispring.presenter.player
SlideTransitionControllerEvent ispring.presenter.player.transitions
SlideType ispring.presenter.presentation.slides
SlideViewedEvent ispring.presenter.player.events
SoundControllerEvent ispring.presenter.player.sound
TooltipEvent ispring.presenter.player.events
TransitionEffectType ispring.presenter.presentation.slides
TransitionPlaybackState ispring.presenter.player.transitions
VideoNarrationPlayerEvent ispring.presenter.player.video.events
WebObjectEvent ispring.presenter.player.events