Hi.
The "move" command, though smooth and easy to use, is sort of an internal stand-alone process in LC, and can be difficult in which to insert your own gadgetry once it gets going.
I could be completely wrong about that poor command, and have maligned it unforgivably. someone will chime in.
Anyway, just to try a completely different approach. In just the button script:
Code: Select all
on mouseUp
set the loc of grc "theGold" to 200,100
set the direction of this cd to "left"
backAndForth
end mouseUp
on backAndForth
if the optionkey is down then exit to top --always a safety to get out
switch the direction of this cd
case "left"
set the left of grc "theGold" to the left of grc "theGold" - 1
break
case "right"
set the left of grc "theGold" to the left of grc "theGold" + 1
break
end switch
if the left of grc "theGold" < 100 then set the direction of this cd to "right"
else if the right of grc "theGold" > 300 then set the direction of this cd to "left"
if the mouse is down and the mouseLoc is within the rect of grc "theGold" then exit to top
else send "backAndForth" to me in 1 millisec
end backAndForth
Not as fast or smooth. But less baggage. If you make the grc small, you can probably live with the crawl.
And so, you others out there, how pliable is the "move" command if you want to slip something by? Messages are live while it, er, moves, but it does seem a little stubborn and uncaring.
Craig Newman