Re: LiveCode: Need help!
Posted: Thu Mar 01, 2012 8:36 pm
Lighten up, Craig <g> you've also taken some shortcuts here with your code that aren't readily absorbable if you're not familiar with the language.
kjetil403 - try this:
the code for the "moveRight" button is similar
well, your example code, for one thing...What made you think you could simply write: "set movement on button "move" to 2000"?
kjetil403 - try this:
Code: Select all
on mouseDown
moveLeft
end mouseDown
on moveLeft
local tCurrentLocation
put the location of button "mover" into tCurrentLocation
if the mouse is down then
set the location of button "mover" to item 1 of tCurrentLocation - 1 & "," & item 2 of tCurrentLocation
else
exit to top
end if
if item 1 of the topleft of button "mover" < the right of this card then
exit to top
end if
send "moveLeft" to me in 1 second
end moveLeft
Code: Select all
on mouseDown
moveRight
end mouseDown
on moveRight
local tCurrentLocation
put the location of button "mover" into tCurrentLocation
if the mouse is down then
set the location of button "mover" to item 1 of tCurrentLocation + 1 & "," & item 2 of tCurrentLocation
else
exit to top
end if
if item 1 of the topleft of button "mover" > the right of this card then
exit to top
end if
send "moveRight" to me in 1 second
end moveRight