Slide.gotoPreviousSlide()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX Professional 2004.

Usage

mySlide.gotoPreviousSlide()

Parameters

None.

Returns

A Boolean value, or null. The method returns true if it successfully navigated to the previous slide; it returns false if the presentation is at the first slide when the method is invoked (that is, if currentSlide.nextSlide is null). The method returns null if invoked on a slide that doesn't contain the current slide.

Description

Method; navigates to the previous slide in the slide presentation. As control passes from one slide to the previous slide, the outgoing slide is hidden and the incoming slide is revealed. If the outgoing and incoming slides are in different slide subtrees, then all ancestor slides, starting with the outgoing slide and up to the common ancestor of the incoming and outgoing slides, are hidden and receive a hide event. Immediately following, all ancestors slides of the incoming slide, up to the common ancestor of the outgoing and incoming slide, are made visible and receive a reveal event.

Typically, gotoPreviousSlide() is called on the leaf node that represents the current slide. If called on a nonleaf node, someNode, then someNode.gotoPreviousSlide() advances to the first leaf node in the previous slide or "section."

This method has no effect when invoked on a slide that does not contain the current slide. This method also has no effect when called from within an on(hide) or on(reveal) event handler attached to a slide, if that handler was invoked as a result of slide navigation.

Example

Suppose that, in the following slide hierarchy, the slide named Intro_bullet_1_2 is the current slide being viewed (that is, _root.Presentation.currentSlide._name == Intro_bullet_1_2).

In this case, calling Intro_bullet_1_2.gotoPreviousSlide() would navigate to Intro_bullet_1_1, which is the previous sibling slide of Intro_bullet_1_2.

However, calling Intro_bullet_2.gotoPreviousSlide() would navigate to Intro_bullet_1_1, the first leaf slide contained by Intro_bullet_1, which is the previous sibling slide of Intro_bullet_2. Similarly, calling Results.gotoPreviousSlide() would navigate to Intro_bullet_1_1, the first leaf slide contained by the Intro slide.

Also, if the current slide is Intro_bullet_1_1, then calling Results.gotoPreviousSlide() would have no effect, since Results does not contain the current slide (that is, Results.currentSlide is null).

See also

Slide.currentSlide, Slide.gotoNextSlide(), Slide.previousSlide