gotoAndStop() and gotoAndPlay()

gotoAndStop() and gotoAndPlay()
gotoAndStop(frame)

Action gotoAndStop () is used to stop the movie at the desired frame. Frame can be filled by using desired frame number or frame label. Consider the following examples:

  • Create a ball movieclip and place to the left of the stage.
  • Click on frame 20 and then insert keyframe. Move ball position to the right stage.
  • Right-click on frame 10 and select create motion tween, it will form ball animation that moves from left to right in a loop.
  • Add new layer above the layer 1 and change its name to action.
  • Click on frame 10 action layer, insert keyframe, then open the action panel and typing action gotoAndStop (1);

  • Run the movie, then when ball reached the middle stage, ball will back and stop to the starting position in left of stage.

gotoAndPlay (frame)

Action gotoAndPlay () used to play the movie on the desired frame, as opposed to the action gotoAndStop ();

note: once when we find action gotoAndStop ("start"); the word "start" is frame label. To add frame label, input keyframe on the desired frame, open Properties panel and typing in <frame label> textbox.


Post a Comment

0 Comments

-------- MASUKAN KODE IKLAN 1 --------
-------- MASUKAN KODE IKLAN 2 --------
-------- MASUKAN KODE IKLAN 3 --------
To Top