Since my virtual pet is aimed at young children, I decided to make a short, simple game for the play button.
The user has to drop and drag the food to the correct animal's bowl.
I downloaded a jungle-sounding tune from www.flashkit.com that plays when the user clicks to play the game.
I applied the actionscript that makes the food draggable and the bowls into drop targets, but when the game was completed nothing happened. So I had to introduce a new variable:
var finish=0;
if (bluefish.onTarget)
finish=finish+1;
if (grass.onTarget)
finish=finish+1;
if (banana.onTarget)
finish=finish+1;
if (finish==3)
gotoAndPlay (100);
This tells flash that when finish is equal to 3 (because there are three drag and drops involved) it must then play frame 100 (where the well done screen is).