jeudi 20 avril 2017

when all the lemon movie clips hit the target I want it to go to a well done screen however im unsure how to

Im using Actionscript 3 in Adobe Flash. Ive tried numerous if statements some have slightly worked however,the one at the moment only considers the fifth movieclip. It should be when all movieclips have hut the target the next scene should play. can you please help? Thanks.

import flash.ui.Multitouch;
import flash.ui.MultitouchInputMode;
import flash.display.MovieClip;

 /* Touch and Drag Event
 Allows the object to be moved by holding and dragging the object.
var objectoriginalX:Number;
var objectoriginalY:Number;
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

var lemons:Array = [lemon1_mc, lemon2_mc, lemon3_mc, lemon4_mc, lemon5_mc];

for each(var lemonMC:MovieClip in lemons)
lemonMC.buttonMode = true;
lemonMC.addEventListener(TouchEvent.TOUCH_BEGIN, pickobject);
lemonMC.addEventListener(TouchEvent.TOUCH_END, dropobject);

lemonMC.startX = lemonMC.x;
lemonMC.startY = lemonMC.y;

 var fl_DragBounds:Rectangle = new Rectangle(0, 0, stage.stageWidth, 

 function pickobject(event:TouchEvent):void
 {, false, fl_DragBounds);;
objectoriginalX =; 
objectoriginalY =;


function dropobject(event:TouchEvent):void
if({ = false; = target_mc.x; = target_mc.y; = false;


 if (lemonMC.hitTestObject(target_mc))
    gotoAndPlay(0,"Scene 2");

else{ =; =; = true;

Aucun commentaire:

Enregistrer un commentaire