Tuesday, February 3, 2009

Heads, you lose






We'll critique your jump pieces in class on Wednesday. A quick note: 400 pixels wide seems to be about the maximum width for embeded .swf files in the blogspot blogs. Bigger widths wreck the layout. If you're working on a bigger piece you can either:
1. Not embed the swf, but post a still with a link to the .swf file.
2. Make a mini-version using the edit multiple frames onion skin option. (Save a copy BEFORE you do this--it can go hilariously wrong.)

Here's a link to the headsy.fla file above. And here's the code:

// headsy.fla ActionScript 2.0 by Miles Inada
// demonstrates how one button can control several movie clip timelines.
// the head movie clips have stops on frame 1 of their timelines.
// the body movie clip is looped and has a still rest frame on frame 40.

but01.onRelease = function(){
head1Ani.gotoAndPlay(2);
head2Ani.gotoAndStop(1);
head3Ani.gotoAndStop(1);
bodyAni.gotoAndStop(40);
}

but02.onRelease = function(){
head1Ani.gotoAndStop(1);
head2Ani.gotoAndPlay(2);
head3Ani.gotoAndStop(1);
bodyAni.gotoAndStop(40);
}

but03.onRelease = function(){
head1Ani.gotoAndStop(1);
head2Ani.gotoAndStop(1);
head3Ani.gotoAndPlay(2);
bodyAni.gotoAndStop(40);
}
//this button is placed over the figure's head to reset all movie clips to 1
clearButton.onRelease = function(){
head1Ani.gotoAndStop(1);
head2Ani.gotoAndStop(1);
head3Ani.gotoAndStop(1);
bodyAni.gotoAndPlay(1);
}

No comments: