Hey all,
I have two problems with a Drag ‘n’ Drop Game im making for University.
First of all, i get a message saying that:
Error #2025: The supplied DisplayObject must be a child of the caller.
The first image i drag and drop into the bin works fine. It’s only when i try to drag the last movie clip into the bin will this message occur.
Lastly, my simple score increment won’t work. After much fiddling about with it, it still does not want to increase.
I have defined in Global Scope that ‘score:int’
And this is the entire method im using to check which object hits which bin. There is probably a better way but i can’t think of one >.<
if (objectArray[2].hitTestObject(rubbish))
{
removeChild(objectArray[2]);
score++;
}
else if (objectArray[3].hitTestObject(rubbish))
{
removeChild(objectArray[3]);
score++;
}
else if (objectArray[0].hitTestObject(recycle))
{
removeChild(objectArray[0]);
score++;
}
else if (objectArray[1].hitTestObject(recycle))
{
removeChild(objectArray[1]);
score++;
}
My text box is already setup above this code. I just wanted to increase the score by 1. But nothing happens. I constantly get the value ‘0’