Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating movieclip buttons to play forward and backward

Status
Not open for further replies.

Flashoid

Technical User
Dec 11, 2002
163
US
I have a 16 frame movieclip (MC labeled animation) that i'd like to have 2 buttons control so when you rollover the forward button it plays the movieclip forward(and loops from frame 16 to 1) and the MC stops on the current frame when you rolloff.

The same with the backward button - when you rollover the button it plays the MC backwards (and loops) and stops the MC in the current frame when you rolloff.

Below is the code I have for the forward button (which works fine) it plays the MC (labeled animation) when you rollover the forward button and stops in the current frame when you rolloff.

However I can not get the backward button to work. I've tried a number of things with no success.


Forward button code:
on (rollOver) {
_root.animation.play()
}

on (rollOut) {
_root.animation.stop();

}


Code in the Back button (which does not work):

on (rollOver) {
_root.animation.prevFrame();

}

on (rollOut) {
_root.animation.stop();

}

I also have this code in frame 1 of the root timeline to stop the animation movieclip from playing when you first enter the movie. It goes to "start" which is frame 1 of the animation movieclip:

tellTarget("animation")

gotoAndStop("start");


Any assistance would be greatly appreciated.
 
[tt]prevFrame()[/tt] moves the playhead to the previous frame then stops, therefore if you wan to move the playhead backwards continuously, you need to call [tt]prevFrame()[/tt] on each [tt]onEnterFrame[/tt] call.

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top