//
//  helloanimationViewController.m
//  helloanimation
//
//  Created by Bess Ho on 8/6/10.
//  Copyright __MyCompanyName__ 2010. All rights reserved.
//

#import "helloanimationViewController.h"

@implementation helloanimationViewController

- (void)viewDidLoad {
	 [super viewDidLoad];
	 
	 // Create a view for animation
	 UIImageView* fireView = [[UIImageView alloc] initWithFrame:self.view.frame];
	 
	 // Load all the frames of our animation
	 fireView.animationImages = [NSArray arrayWithObjects:	
									 [UIImage imageNamed:@"campFire01.gif"],
									 [UIImage imageNamed:@"campFire02.gif"],
									 [UIImage imageNamed:@"campFire03.gif"],
									 [UIImage imageNamed:@"campFire04.gif"],
									 [UIImage imageNamed:@"campFire05.gif"],
									 [UIImage imageNamed:@"campFire06.gif"],
									 [UIImage imageNamed:@"campFire07.gif"],
									 [UIImage imageNamed:@"campFire08.gif"],
									 [UIImage imageNamed:@"campFire09.gif"],
									 [UIImage imageNamed:@"campFire10.gif"],
									 [UIImage imageNamed:@"campFire11.gif"],
									 [UIImage imageNamed:@"campFire12.gif"],
									 [UIImage imageNamed:@"campFire13.gif"],
									 [UIImage imageNamed:@"campFire14.gif"],
									 [UIImage imageNamed:@"campFire15.gif"],
									 [UIImage imageNamed:@"campFire16.gif"],
									 [UIImage imageNamed:@"campFire17.gif"], nil];
	 
	 // Each Animation loop run for 2 sec
	 fireView.animationDuration = 2.00;
	 // Repeat animation indefinitely
	 fireView.animationRepeatCount = 0;
	 // start animating
	 [fireView startAnimating];
	 // add the animation view
	 [self.view addSubview:fireView];
	 [fireView release]; 
	 
 }

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}

- (void)dealloc {
    [super dealloc];
}

/*
 // The designated initializer. Override to perform setup that is required before the view is loaded.
 - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
 if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {
 // Custom initialization
 }
 return self;
 }
 */

/*
 // Implement loadView to create a view hierarchy programmatically, without using a nib.
 - (void)loadView {
 }
 */

@end
