Drag and Drop Help.
Posted: Tue Dec 18, 2018 8:19 am
I have been working on a drag and drop quiz and have run into a problem. I have been working on learning how to count in spanish. I have the 10 numbers in a group on the side called "numbers" and would like to grab the text from my group "numbers" and then be able to put them in a field called "answers." I am able to put them into the field but not sure how to make it the objects look as if they go from line 1 of the field all the way to line 10. This is my code that I have so far. I am still new to livecode and learning the ropes:) I know that I am missing some code and would appreciate the help. Thanks!
on mouseDown
grab the target
put the short name of the target into tVar
end mouseDown
on mouseUp
repeat with x = 1 to number of fields in group "numbers"
if within(fld "numbers", the loc of the target) then
move fld tVar of group "numbers" to the loc of line x of fld "numbers" in 10 ticks without waiting
disable fld tVar of me
add 1 to x
else
set the loc of fld gBox of me to the startLoc of fld gBox of me
end if
end repeat
end mouseUp
on mouseDown
grab the target
put the short name of the target into tVar
end mouseDown
on mouseUp
repeat with x = 1 to number of fields in group "numbers"
if within(fld "numbers", the loc of the target) then
move fld tVar of group "numbers" to the loc of line x of fld "numbers" in 10 ticks without waiting
disable fld tVar of me
add 1 to x
else
set the loc of fld gBox of me to the startLoc of fld gBox of me
end if
end repeat
end mouseUp