The Drag and Drop code can be found here: http://say-web.com/2009/08/12/actionscript-3-0-lesson-13-drag-and-drop-removing-event-listener/
HERE IS THE SOURCE CODE!
// Avraham Saltoun
// solutions at say-web dot com
// FREE to USE, COPY and DISTRIBUTE
import fl.transitions.Tween;
import fl.transitions.easing.*;
// Delcaring Variables
var currentLetter_mc : MovieClip;
var myCounter:int =0;
var bounceTween:Tween;
var howManyLetters:int= 22;
Letters_btn.addEventListener(MouseEvent.CLICK, distributeLetters);
function distributeLetters(event:MouseEvent) :void
{
myCounter =0;
while (myCounter < howManyLetters){
switch (Math.round(Math.random()*2)){
case (0):
var newA:MovieClip = new letterA();
currentLetter_mc= newA
break;
case (1):
var newB:MovieClip = new letterB();
currentLetter_mc= newB
break;
case (2):
var newC:MovieClip = new letterC();
currentLetter_mc= newC
break;
}
stage.addChild(currentLetter_mc);
currentLetter_mc.x = Math.round(Math.random()*450);
currentLetter_mc.y = -1;
bounceTween = new Tween (currentLetter_mc,'y',Bounce.easeOut,currentLetter_mc.y, Math.round(Math.random()*450),3,true);
myCounter = myCounter +1;
}
}






102 Responses to “The Letter Game Part 1”
Trackbacks/Pingbacks
…A Friend recommended your blog…
[...]Great weblog right here! Additionally your website rather a lot up very fast!http://www.celularbarato.net.br [...]…
…Visitor recommendations…
[...]I am no longer certain the place you’re getting your information, but great topic.http://michaelkors.net.br [...]…