03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - 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.

this._parent.play();<br />

};<br />

Use the following ActionScript to play the Timeline of a movie clip in a SWF file. This<br />

ActionScript is for a button called my_btn on the main Timeline that plays a movie clip called<br />

animation_mc:<br />

animation_mc.stop();<br />

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

animation_mc.play();<br />

};<br />

See also<br />

play function, gotoAndPlay (MovieClip.gotoAndPlay method), gotoAndPlay<br />

function<br />

prevFrame (MovieClip.prevFrame method)<br />

public prevFrame() : Void<br />

Sends the playhead to the previous frame <strong>and</strong> stops it.<br />

You can extend the methods <strong>and</strong> event h<strong>and</strong>lers of the MovieClip class by creating a subclass.<br />

Example<br />

In the following example, two movie clip buttons control the Timeline. The prev_mc button<br />

moves the playhead to the previous frame, <strong>and</strong> the next_mc button moves the playhead to the<br />

next frame. Add content to a series of frames on the Timeline, <strong>and</strong> add the following<br />

ActionScript to Frame 1 of the Timeline:<br />

stop();<br />

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

var parent_mc:MovieClip = this._parent;<br />

if (parent_mc._currentframe>1) {<br />

parent_mc.prevFrame();<br />

} else {<br />

parent_mc.gotoAndStop(parent_mc._totalframes);<br />

}<br />

};<br />

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

var parent_mc:MovieClip = this._parent;<br />

if (parent_mc._currentframe

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

Saved successfully!

Ooh no, something went wrong!