on (release) {
ShortHat.gotoAndPlay(2) ;
}
You already know how the on (release) and gotoAndPlay commands work; we've told the button that when the mouse click releases, it needs to go to and play frame 2 (frame 1 has a stop on it, remember, so starting on frame 2 will play the animation). This difference is that in previous instances, we've told it to go to and play frame 2 of the current scene, or another scene; this time, we're directing it to an entirely separate timeline nested inside a movie clip. The part of the code that does that is:
ShortHat.
Adding this parameter before the gotoAndPlay command (the period acts as a separator) tells Flash that it needs to access the timeline inside the instance ShortHat of the movie clip HatShort, and then play from there.
And it's that simple. To see a demonstration of just the animated hat, click here.


