i'm developing an drag and drop alphabet game in flash cs5(AS3). the goal is to select 1 among the 3 given objects that start w/ the given alphabet and drag it onto the box beside the alphabet. i use external A.S. file. just like this tutorial: http://www.youtube.com/watch?v=ALqGYMsRWxw
i created 26 objects/mcs divided by 3 choices per alphabet. I named it :
False_duck, True_apple, False_clock. per scene
My problem is:
*How can i make mcs with 'True' as correct and all mcs with 'False' as incorrect answer when dragged into the box(target).
any suggestions and reply would greatly appreciated! thanks!
thanks a lot! but the hittest code still didn't work. this is my code for the main AS file.
in this ff. code i changed the instance name of 3 mcs as True1, False1,False2.
__________________________________________________ ________________________
package data.scripts {
protected var OP:Point
public function DragDropTarget()
{
// constructor code
OP = new Point (x,y);
buttonMode = true;
addEventListener(MouseEvent.MOUSE_DOWN, down);
}
protected function down( event:MouseEvent ):void
{
parent.addChild( this);
startDrag();
stage.addEventListener(MouseEvent.MOUSE_UP, stageUp);
}
protected function stageUp(event:MouseEvent):void
else
{
returnToOP();
}
}
else
{
trace("drop sumthing");
}
}
protected function returnToOP():void
{
x=OP.x;
y=OP.y;
}
}
}
__________________________________________________ ________________________
On the bold text. its not working but i want it to read and identify the "True" + the number followed in an instance name.
i have 26 Mcs with "True"+Numbers Ins Name. thats why i want to have a main AS file which can generate all 26 A.S. file through Class.
I have 26 MCs and using only one target. 26 True and 26 false. (note that on the picture above i divided 26 MCs by 3 MCs as choices per scene.) if i named all 26 true MCs(correct answer) with True1, True2, etc... and 26 false MCs w/ False1, False2 etc...
and drag it to only one target, the target then identify which MCs has "True" and "False"
at the beginning of their Ins. Name. and trace it IF its correct answer or not.
my only problem is on the bold text as i didnt make the target identify all the false MCs and the True MCs based on their INstance name. I didnt know how to use currentTarget as well. the code is from an external AS3 file that is the source code of the 26 MCs. they are linked by a class.
Can you give me some idea?