Skin AnimationsDownload Example

// Class Main.as
package  
{
	import flare.basic.Scene3D;
	import flare.basic.Viewer3D;
	import flare.core.Pivot3D;
	import flare.system.Input3D;
	import flare.utils.Pivot3DUtils;
	import flash.display.Sprite;
	import flash.events.Event;
	
	public class Main extends Sprite
	{
		private var scene:Scene3D
		private var biped:Pivot3D
		private var active:Boolean = true
		
		public function Main() 
		{
			stage.quality = "medium"
			
			// creates the scene.
			scene = new Viewer3D( this )
			
			// define progress and complete events.
			scene.addEventListener( Scene3D.PROGRESS_EVENT, progressEvent )			
			scene.addEventListener( Scene3D.COMPLETE_EVENT, completeEvent )			
			
			// loads the animated character.
			biped = scene.addChildFromFile( "skin.f3d" )
		}
		
		private function progressEvent(e:Event):void 
		{
			// ...
		}
		
		private function completeEvent(e:Event):void 
		{
			// add some labels. ( the labels also can be defined in 3DMax ).
			biped.addLabel( "anim1", 0, 30 )
			biped.addLabel( "anim2", 30, 72 )
			
			// for smooth animation when the frameSpeed property is less than 1.
			biped.animationPrecision = true
			
			// begin update the scene.
			scene.addEventListener( Scene3D.UPDATE_EVENT, updateEvent )
		}
		
		private function updateEvent(e:Event):void 
		{
			// play and stop the animation.
			if ( Input3D.keyHit( Input3D.P ) ) biped.play()
			if ( Input3D.keyHit( Input3D.S ) ) biped.stop()
			
			// inverse the frameSpeed.
			if ( Input3D.keyHit( Input3D.F ) ) biped.frameSpeed = -biped.frameSpeed
			
			// increment and decrement the speed of animation.
			if ( Input3D.keyHit( Input3D.Z ) ) biped.frameSpeed -= 0.1
			if ( Input3D.keyHit( Input3D.X ) ) biped.frameSpeed += 0.1			
			if ( Input3D.keyHit( Input3D.R ) ) biped.frameSpeed = 1
			
			// play labels in loop.
			if ( Input3D.keyHit( Input3D.NUMBER_1 ) ) biped.playLabel( "anim1" )
			if ( Input3D.keyHit( Input3D.NUMBER_2 ) ) biped.playLabel( "anim2" )
			
			// play labels with no loop.
			if ( Input3D.keyHit( Input3D.NUMBER_3 ) ) biped.playLabel( "anim1", false )
			if ( Input3D.keyHit( Input3D.NUMBER_4 ) ) biped.playLabel( "anim2", false )
			
			// enable / diable bone animations.
			if ( Input3D.keyHit( Input3D.SPACE ) ) 
			{
				active = !active
				scene.getChildByName( "Bip01 R UpperArm" ).animationEnabled = active
				scene.getChildByName( "Bip01 L UpperArm" ).animationEnabled = active
			}
		}
	}
}