I have a stack that contains one image...the code below is in the card script.
In Rev 2.6, this works a treat, the image moves smoothly in the stack window. Unfortunately, in Rev 3.5 it only seems to update after the mouse has been released. Movements are very jerky to say the least...
Code: Select all
local startClick,imageRect,imageW,imageH,cardW,cardH
on mouseDown
if the clickLoc is mouseLoc() then
put the clickLoc into startClick
put the the rectangle of image "picView" into imageRect
put the width of image "picView" into imageW
put the height of image "picView" into imageH
put the width of this card into cardW
put the height of this card into cardH
movePic
end if
end mouseDown
on movePic
repeat until the mouse is up
put (item 1 of imageRect + (item 1 of mouseLoc() - item 1 of startClick)) into HorzDiff
put (item 2 of imageRect + (item 2 of mouseLoc() - item 2 of startClick)) into VertDiff
if HorzDiff >= 0 then put 0 into HorzDiff
if VertDiff >= 0 then put 0 into VertDiff
if HorzDiff <= (- imageW) - (- cardW) then put (- imageW) - (- cardW) into HorzDiff
if VertDiff <= (- imageH) - (- cardH) then put (- imageH) - (- cardH) into VertDiff
set the topleft of image "picView" to HorzDiff,VertDiff
put the rectangle of image "picView" into imageRect
end repeat
end movePic