Hi,
Ok, I have a button that, when pressed, should animate/play a png image sequence.
My problem is -
- I press the button (button A) and the image sequence plays - which is good!
- but then I press (button A) again and nothing happens. - bad.
- but then... if I press (button A) a third time - the image sequence plays.
So basically, the image sequence only plays every second time I press the button?...I can't think what could be causing that?
Another scenario which might give you clues to the problem -
- I press the button (button A) and everything works fine
- I press a different button (button B) and it does its different thing
- Then I press (button A) again and everything works fine.
So it seems, the image sequence only plays if something else happens in between (button A) presses?
Any ideas?
Here is the code... The views "viewDidLoad" has [self loadAnimX01];
- (void) loadAnimX01 {
x01 = [[UIImageView alloc] initWithFrame:CGRectMake(35.0f, 112.0f,70.0f, 115.0f)];
NSMutableArray *array = [NSMutableArray array];
for (int i = 1; i <= 15; i++)
[array addObject:[UIImage imageNamed:[NSString stringWithFormat:@"pipe01_%02d.png",i]]];
x01.animationImages = array;
x01.animationDuration = 0.7;
x01.animationRepeatCount = 1;
[self.view addSubview:x01];
[x01 release];
}
- (IBAction)pX01 {
[x01 startAnimating];
}
Thanks!