REVO2700#Confine Control within Card Border2@nU40 5#Confine Control within Card Border ULucida Grande UMenlo Regular UBitstream Vera Sans Mono cREVGeneralbreakpointconditions breakpointsbreakpointstates @40 Field@;e[ cREVGeneral revUniqueID 1325805480221  eThe red button contains a simple script that keep the entire button within the borders of this card.ButtonA won mouseDown put the rect of this cd into myRect put the mouseLoc into myMouseLoc put item 1 of myMouseLoc - item 1 of the loc of me & comma & item 2 of \ the mouseLoc - item 2 of the loc of me into myDiff repeat until the mouse is up with messages put item 1 of the mouseLoc - item 1 of myDiff & comma & item 2 of \ the mouseLoc - item 2 of myDiff into myNewLoc put the width of me / 2 into myWMargin put the height of me / 2 into myHMargin if item 1 of myNewLoc - myWMargin < 0 then put myWMargin into item 1 of myNewLoc else if item 1 of myNewLoc + mywMargin > the width of this cd then put the width of this cd - myWMargin into item 1 of myNewLoc end if if item 2 of myNewLoc - myHMargin < 0 then put myHMargin into item 2 of myNewLoc else if item 2 of myNewLoc + myHMargin > the height of this cd then put the height of this cd - myHMargin into item 2 of myNewLoc end if set the loc of me to myNewLoc wait 0 millisecs with messages end repeat end mouseDown :QQQQQQ駧555555006 cREVGeneral revUniqueID 1323917027633scripteditorvscroll0scripteditorselection1184 revOnline | RunRev