I’m trying to write an if then statement that will loop back to frame 1 once the next frame it hits is higher than 5. For some reason it doesn’t work and I could easily go to frame six and add a go to and play but, I’d like to learn what’s wrong instead of doing it the easy way.
on (release) {
if (_root.player_currentframe > 5) {
gotoAndPlay(1);
} else {
_root.player.nextFrame();
}
}
Replace your code for this one: [AS]on (release) {
if (_root.player._currentframe>5) {
_root.player.gotoAndPlay(1);
} else {
_root.player.nextFrame();
}
}[/AS]
[edit]I assumed you wanted your player movie clip to go back to freame 1. And you missed a dot before _currentframe.[/edit]
Of course it wont work. Your player movie clip has exactly 5 frames, so the statement if currentframe>5 will never be true.
Change for this:[AS]on (release) {
if (_root.player._currentframe==5) {
_root.player.gotoAndPlay(1);
} else {
_root.player.nextFrame();
}
}
[/AS]
Since your both reading this thread and the file is posted. Either of you feel like taking a look at how I might go about getting my counter working to show the duration of the song?