03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

};<br />

Key.addListener(someListener);<br />

init = 1;<br />

}<br />

See also<br />

prevFrame function<br />

nextScene function<br />

nextScene() : Void<br />

Sends the playhead to Frame 1 of the next scene.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 2<br />

Example<br />

In the following example, when a user clicks the button that is created at runtime, the<br />

playhead is sent to Frame 1 of the next scene. Create two scenes, <strong>and</strong> enter the following<br />

<strong>ActionScript</strong> on Frame 1 of Scene 1.<br />

stop();<br />

if (init == undefined) {<br />

this.createEmptyMovieClip("nextscene_mc", this.getNextHighestDepth());<br />

nextscene_mc.createTextField("nextscene_txt", this.getNextHighestDepth(),<br />

200, 0, 100, 22);<br />

nextscene_mc.nextscene_txt.autoSize = true;<br />

nextscene_mc.nextscene_txt.border = true;<br />

nextscene_mc.nextscene_txt.text = "Next Scene";<br />

this.createEmptyMovieClip("prevscene_mc", this.getNextHighestDepth());<br />

prevscene_mc.createTextField("prevscene_txt", this.getNextHighestDepth(),<br />

00, 0, 100, 22);<br />

prevscene_mc.prevscene_txt.autoSize = true;<br />

prevscene_mc.prevscene_txt.border = true;<br />

prevscene_mc.prevscene_txt.text = "Prev Scene";<br />

nextscene_mc.onRelease = function() {<br />

nextScene();<br />

};<br />

prevscene_mc.onRelease = function() {<br />

prevScene();<br />

};<br />

init = true;<br />

}<br />

Global Functions 83

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!