Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-29-2009, 07:29 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 48
Question Multiple Animations with UIImageView

I'm having a bit of difficulty loading multiple animations in my viewDidLoad function.

Code:
- (void)viewDidLoad {
[super viewDidLoad];
spaceship.animationImages=[NSArray arrayWithObjects: [UIImage imageNamed: @"spaceship.png"], [UIImage imageNamed: @"spaceship1.png"], nil];
	[spaceship setAnimationRepeatCount:1e100f];
	spaceship.animationDuration = 0.15;
	[spaceship startAnimating];
	
	spaceship1.animationImages=[NSArray arrayWithObjects: [UIImage imageNamed: @"explode1.png"], 
							   [UIImage imageNamed: @"explode2.png"], 
							   [UIImage imageNamed: @"explode3.png"], 
							   [UIImage imageNamed: @"explode4.png"], 
							   [UIImage imageNamed: @"explode5.png"], 
							   [UIImage imageNamed: @"explode6.png"], 
							   [UIImage imageNamed: @"explode7.png"], 
							   [UIImage imageNamed: @"explode8.png"], 
							   [UIImage imageNamed: @"explode9.png"], 
							   [UIImage imageNamed: @"explode10.png"], 
							   [UIImage imageNamed: @"explode1.1png"], 
							   [UIImage imageNamed: @"explode12.png"], 
							   [UIImage imageNamed: @"explode13.png"], 
							   [UIImage imageNamed: @"explode14.png"], 
							   [UIImage imageNamed: @"explode15.png"], 
							   [UIImage imageNamed: @"explode16.png"], 
							   [UIImage imageNamed: @"explode17.png"], 
							   [UIImage imageNamed: @"explode18.png"], 
							   [UIImage imageNamed: @"explode19.png"], 
							   [UIImage imageNamed: @"explode20.png"], 
							   [UIImage imageNamed: @"explode21.png"], 
							   [UIImage imageNamed: @"explode22.png"], nil];
	[spaceship1 setAnimationRepeatCount:1];
	spaceship1.animationDuration = 0.5;
}
Basically the spaceship and spaceship1 are UIImageViews linked in Interface Builder to the same image. The spaceship.png and spaceship1.png wont animate when the explode.png animation is present in the viewDidLoad function. If I remove the explode.png animation, the spaceship, spaceship1.png animation works fine. The explode animation is started using [spaceship1 startAnimating]; in another part of the code and it runs the animation correctly. How can I get both these animations to load on the single UIImageView? Thanks.
__________________
Discover new apps through art! Sound weird? Check it out! BigAppAd!
Follow me on Twitter!
JavaWizKid is offline   Reply With Quote
Reply

Bookmarks

Tags
animate, iphone, multiple, uiimageview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 258
17 members and 241 guests
ADY, Alsahir, dacapo, Dani77, Desert Diva, djohnson, F_Bryant, Grinarn, HemiMG, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,762
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0