FORUMS: list search recent posts

Reset objects in a drag and drop game

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ben Fisher
Reset objects in a drag and drop game
on Jan 25, 2010 at 8:19:02 am

i am following a tutorial to create a game where you drag pictures of Egyptian gods to match them with their name. when all the images are matched, it goes to the second frame which tells the user they have finished. i want to add a button which would allow the user to play again, but i need to reset all the objects first. how do i do that?

here's the code i've got:

var score:Number = 0;
var objectoriginalX:Number;
var objectoriginalY:Number;
thoth_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
thoth_mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);
sobek_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
sobek_mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);
ptah_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
ptah_mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);
sekhmet_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickupObject);
sekhmet_mc.addEventListener(MouseEvent.MOUSE_UP, dropObject);
function pickupObject(event:MouseEvent):void {;;;;
response_txt.text=" ";
function dropObject(event:MouseEvent):void {;
var matchingTargetName:String="target";
var matchingTarget:DisplayObject=getChildByName(matchingTargetName);
if (!=null&& {, pickupObject);, dropObject);;;;
score_txt.text = String(score);
} else {;;
response_txt.text="Try Again";
if (score == 4){

huge thanks in advance,

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved