Iphone幻灯片效果+背景音乐

-(void)viewDidLoad
{
 
array = [[NSMutableArray alloc] init];
 
int i = 1;
 
for(i;i<=30;i++)
 
{
 
[array addObject:[UIImageimageNamed:[NSString stringWithFormat:@"%d.jpg",i]]];
 
}
 
pictures.animationImages = array;
 
pictures.animationDuration = 300;//时间间隔
 
pictures.animationRepeatCount = 0;//循环播放
 
[pictures startAnimating];//开始播放



//播放背景音乐,利用SoundEngine类进行播放
 
SoundEngine_SetListenerPosition(0.0, 0.0,1.0);
 
SoundEngine_Initialize(44100);
 
SoundEngine_LoadBackgroundMusicTrack([[[NSBundlemainBundle] pathForResource:@"win" ofType:@"caf"] UTF8String],true, true);
 
SoundEngine_StartBackgroundMusic();
}

posted @ 2011-09-20 11:19  Gang.Wang  阅读(850)  评论(0编辑  收藏  举报