Action when target score reached

Im new to Flash and prefer to learn myself but this one has be stumped.

I recently completed the tutorial on kirupa for creating a platform game.
http://www.kirupa.com/developer/mx2004/platform_game.htm

Ive edited the level so they include a lot more “pick ups” and bad guy" and it all works dandy.

Ive gone ahead and create 3 other levels using a similar technique and when the user collects 20 coins then they go onto the next level. Im not entirely sure how to do that is the problem.

I tried adding this code to the pick up items but it doesnt work.

if (_root.score == 20) {
gotoAndStop(5);

Frame 5 has the second level and frame 7 has the 3rd level.
The pick up item code before i changed it was

onClipEvent (enterFrame) {
if (this.hitTest(_root.char)) {
// if this hits the char (_root.char)
_root.score.text++;
// _root.score goes up 1
unloadMovie(this);
// this movie clip is unloaded
}
}

Can anyone give me a hand on how to do this. I just need it linking from one level to the next once the user has the desired score.

Many Thanks in advance

Chris