Try this in the image āPā script on mouseUp repeat with x = 1 to the number of controls if the loc of target is within the rect of control x then if ("P" is in the short name of control x) AND (the ID of the target is not the ID of control x) then set the loc of target to the loc of control x exit repeat else move me to 350,350 end if end if end repeat end mouseUp
> On Aug 27, 2016, at 3:22 AM, Richmond <richmondmathew...@gmail.com> wrote: > > I'm obviously getting something rather wrong, so I have uploaded something > here as explaining things without a sample stack and a pretty picture is > well-nigh impossible: > > http://forums.livecode.com/viewtopic.php?f=7&t=27837 > > Richmond. > > On 27.08.2016 00:59, Jeanne A. E. DeVoto wrote: >> At 12:27 AM +0300 8/27/2016, Richmond wrote: >>> This doesn't seem to work because this cycles through ALL the controls, >>> and, of course, >>> the object being dragged is also a control. >> >> >> Ah. Forgot about that. You'll need to add a condition: >> >> if within(control x, the mouseLoc) \ >> AND ("P" is not in the short name of control x) >> AND (the ID of the target is not the ID of control x) then >> >> >> _______________________________________________ >> use-livecode mailing list >> use-livecode@lists.runrev.com >> Please visit this url to subscribe, unsubscribe and manage your subscription >> preferences: >> http://lists.runrev.com/mailman/listinfo/use-livecode > > > _______________________________________________ > use-livecode mailing list > use-livecode@lists.runrev.com > Please visit this url to subscribe, unsubscribe and manage your subscription > preferences: > http://lists.runrev.com/mailman/listinfo/use-livecode _______________________________________________ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode