Showing posts with label Demo File. Show all posts
Showing posts with label Demo File. Show all posts

Sunday, October 18, 2009

Walk Cycle Demo Videos




Here are the step by step videos on creating a 9 frame stick figure walk cycle in Flash. Enjoy.

Video 1: Contact and Passing keys.

Video 2: Up and Down keys.


Video 3: In-Betweens.

Video 4: Converting the step to a cycle.

Click here to download the .fla file of the stick figure walk before it is converted to a cycle.
Click here to download the .fla file of the stick figure walk converted to a cycle.

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);
}

Monday, February 2, 2009

Doors of Perception




Head on over to Inadaville to check out a moving advent calendar solution.
Click here for the .fla file for the little door above.
Click here for the full moving doors .fla file o'er at Inadaville.
If you download the full moving doors, make sure you download this Door.as file and put it in the same location as the .fla file--otherwise the .fla file will not work.

Here's the code:
//Actionscript 2.0 doortestAS205.fla by Miles Inada

// Declare a boolean variable named shut, whose value (true or false) will indicate whether the door is currently shut (true) or open (false).
var shut:Boolean = true;

// Define the function openShutDoor. This function will check to see if the shut condition is true or false and act accordingly.
function openShutDoor() {
//check to see if the door is open or shut
if (shut) {
//if it's shut, open it
theDoor.gotoAndPlay(2);
//tell the program the door is now open
shut = false;
}else {
// if it's open, shut it
theDoor.gotoAndPlay(1);
//tell the program the door is now shut
shut = true;
} //end else
} // end function openShutDoor

// When theButton is clicked, run the openShutDoor function we've defined above
theButton.onRelease = openShutDoor;

// theDoor is a movie clip with a stop command on frame 1

Wednesday, January 14, 2009

Embed a Button




Click the text above and see if this works. I'm not sure why the button is taking up so much space in the blog. Here's the flash file that generated the code. Thanks to Jake for tracking down the embed source code example.
UPDATE--I fixed the whoppin' space around the button issue. If you pay even a small amount of attention to the source code, you'll see that you have to enter height and width pixel dimensions in two places. I only entered them in one place. Oops. Goes along with my typo, I guess.