Import image "pieceofpaper.gif" (File > Import Image) and move it outside visible area.
Convert it to sprite (Edit > Convert to Sprite), name it "Garbage" and check "ActionScript" target (Item > Placement Properties)
Import image "opentrash.gif" and move it to X:170, Y:118 (Edit > Move To) .
Draw an ellipse over the hole of the trash. Set fill color to black, 1% opacity, no line
Convert it to sprite, name it "Hole" and check "ActionScript" target
Add the text "Put all papers into trash"
Add Frame ActionScript (Frame > ActionScript):
maxpapers=1;
Frame 2
Add the text "GET READY!"
Set background to "Frame 1"
Frame 3
Set frame delay to "Stop"
Set background to "Frame 1"
Import "laser.wav" sound and set the frame sound
Add Frame ActionScript:
maxpapers = maxpapers * 2; // at each run increase the number of pieces
collected = 0; // count collected items
function checkifallcollected()
{
// check if all items are collected and go to congratulations frame
if(collected==maxpapers) gotoAndPlay("Frame 4");
}
// this array will hold all pieces
var garbages = new Array();
// create maxpapers pieces
for(i=0;i<maxpapers;i++)
{
// create new instance of the paper
garbage[i] = Garbage.duplicateMovieClip("garbage"+i,100+i);
// put it in random place and random rotation
garbage[i]._x = 30+100*Math.random();
garbage[i]._y = 30+200*Math.random();
garbage[i]._rotation = 360*Math.random();
// define mouse events
garbage[i].onPress=function() { this.startDrag();};
garbage[i].onRelease=function()
{
// check if this piece hits the hole
if(this._droptarget=="/Hole") {this.removeMovieClip();collected++;}
stopDrag();
checkifallcollected();
};
}
Frame 4
Import "elecshot.wav" sound and set the frame sound
Import image "closedtrash.gif" and move it to X:174, Y:163.