Dragging an object

Peter Bogdanoff bogdanoff at me.com
Thu Jul 10 22:02:50 EDT 2014


That doesn’t seem to be good for my immediate challenge—I’m able to restrict the motion to horizontal OK. It’s getting the control to move smoothly no matter where on it you click.

On Jul 10, 2014, at 5:54 PM, Roger Eller <roger.e.eller at sealedair.com> wrote:

> 
> On Jul 10, 2014 8:24 PM, "Peter Bogdanoff" <bogdanoff at me.com> wrote:
> 
>> Hi,
>> 
>> I want to drag an object around (a group), restricting its Y coordinate
>> (set to be a property, “yLocation"). I’m using this script inside the
>> object:
>> 
>> on mouseMove
>>   if the mouse is down then
>>      set the loc of me to (item 1 of the mouseLoc,the yLocation of me)
>>   end if
>> end mouseMove
>> 
>> However, after moving it sideways, when I click on it again to move it,
>> every time it jumps back so that its X coordinate is zero relative to the
>> mouseLoc.
>> 
>> This behavior would be fine for a button, but I’m dragging a
>> 3000-pixel-wide group.
>> 
>> How can I drag it by clicking on one side of this group?
>> 
>> I tried using the grab command, but I couldn’t seem to be able to restrict
>> the Y coordinate with that.
>> 
>> Peter
>> UCLA
>> 
>> _______________________________________________




More information about the use-livecode mailing list