Hi All
I have a flash application which is kind of quiz game. User has to drag and drop the option in appropriate location. Options and questions are movie clips on stage with text field, when I drag and drop the option on question I am unable to retrieve the text field content of the question. However I am able to retrieve textfield content of option.
function drag(evt:MouseEvent) {
trace("target name is "+evt.target.parent.name); \ arget name is o0
var textName:String=evt.target.parent.name;
var targetName:DisplayObject=getChildByName(textName);
trace(targetName.sname.text);
startx=evt.target.parent.x;
starty=evt.target.parent.y;
targetName.startDrag(true);
}
function drop(evt:MouseEvent) {
var textName:String=evt.target.parent.name;
var targetName:DisplayObject=getChildByName(textName);
targetName.stopDrag();
trace(targetName.x +" "+targetName.y); \\65 60
evt.target.parent.x=startx;
evt.target.parent.y=starty;
trace("target name is "+targetName.dropTarget.name); \ arget name is instance20
var dropTargetN:String=targetName.dropTarget.name;
trace("dropTargetN "+dropTargetN); \\dropTargetN instance20
var dropTargetName:DisplayObject=getChildByName(dropTargetN);
trace("Text of droptarget "+dropTargetName); \\Text of droptarget null
}
Trace of above code shows
target name is o0
Cu
65 60
target name is instance20
dropTargetN instance20
Text of droptarget null
How do I get the text field content of the questions? I have tried adding the options and questions on stage programatically too. Any help would be appreciated.
Thanks in advance