i wanna knw an alternate to this animation code..
-(void)movetree{
//[tree1 release];
treeMove = YES;
tree1.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"moving trees1.png"],
[UIImage imageNamed:@"moving trees2.png"],
[UIImage imageNamed:@"moving trees3.png"],
[UIImage imageNamed:@"moving trees4.png"],
[UIImage imageNamed:@"moving trees5.png"],
[UIImage imageNamed:@"moving trees6.png"],
[UIImage imageNamed:@"moving trees7.png"],
[UIImage imageNamed:@"moving trees8.png"],
[UIImage imageNamed:@"moving trees9.png"],
[UIImage imageNamed:@"moving trees10.png"],
[UIImage imageNamed:@"moving trees11.png"],
[UIImage imageNamed:@"moving trees12.png"],
[UIImage imageNamed:@"moving trees13.png"],
[UIImage imageNamed:@"moving trees14.png"],
[UIImage imageNamed:@"moving trees15.png"],
[UIImage imageNamed:@"moving trees16.png"],
[UIImage imageNamed:@"moving trees17.png"],
[UIImage imageNamed:@"moving trees18.png"],
[UIImage imageNamed:@"moving trees19.png"],
[UIImage imageNamed:@"moving trees20.png"],
[UIImage imageNamed:@"moving trees21.png"],
[UIImage imageNamed:@"moving trees22.png"],
[UIImage imageNamed:@"moving trees23.png"],
[UIImage imageNamed:@"moving trees24.png"],
[UIImage imageNamed:@"moving trees25.png"],
[UIImage imageNamed:@"moving trees26.png"],
[UIImage imageNamed:@"moving trees27.png"],
[UIImage imageNamed:@"moving trees28.png"],
[UIImage imageNamed:@"moving trees29.png"],
[UIImage imageNamed:@"moving trees30.png"],
[UIImage imageNamed:@"moving trees31.png"],
[UIImage imageNamed:@"moving trees32.png"],
[UIImage imageNamed:@"moving trees33.png"],
[UIImage imageNamed:@"moving trees34.png"],
[UIImage imageNamed:@"moving trees35.png"],
[UIImage imageNamed:@"moving trees36.png"],
[UIImage imageNamed:@"moving trees37.png"],
[UIImage imageNamed:@"moving trees38.png"],
[UIImage imageNamed:@"moving trees39.png"],
[UIImage imageNamed:@"moving trees40.png"],
[UIImage imageNamed:@"moving trees41.png"],
[UIImage imageNamed:@"moving trees42.png"],
[UIImage imageNamed:@"moving trees43.png"],
[UIImage imageNamed:@"moving trees44.png"],
[UIImage imageNamed:@"moving trees45.png"],
[UIImage imageNamed:@"moving trees46.png"],
[UIImage imageNamed:@"moving trees47.png"],
[UIImage imageNamed:@"moving trees48.png"],
[UIImage imageNamed:@"moving trees49.png"],
[UIImage imageNamed:@"moving trees50.png"],
[UIImage imageNamed:@"moving trees51.png"],
[UIImage imageNamed:@"moving trees52.png"],
[UIImage imageNamed:@"moving trees53.png"],
[UIImage imageNamed:@"moving trees54.png"],
[UIImage imageNamed:@"moving trees55.png"],
[UIImage imageNamed:@"moving trees56.png"],
[UIImage imageNamed:@"moving trees57.png"],
[UIImage imageNamed:@"moving trees58.png"],
[UIImage imageNamed:@"moving trees59.png"],
[UIImage imageNamed:@"moving trees60.png"],nil];
// all frames will execute in 1.75 seconds
tree1.animationDuration =1.75;
// repeat the annimation forever
tree1.animationRepeatCount = 0;
// start animating
[tree1 startAnimating];
// add the animation view to the main window
//[bgview addSubview:campFireView];
[tree1 release];
player.numberOfLoops = -1;
[player play];
}
Is there any other way to show animation using frames?? this method seems to be heavier and it crashes alot..
See Question&Answers more detail:
os