global gButUpdated, gAudioWindow, gquitWindow, BookmarkWindow
if not listp(regionList) then
return
end if
set currH to the mouseH
set currV to the mouseV
if objectp(gAudioWindow) then
return
end if
if objectp(gquitWindow) then
return
end if
if objectp(BookmarkWindow) then
set testRect to the rect of BookmarkWindow
setAt(testRect, 1, getAt(testRect, 1) - the stageLeft - 1)
setAt(testRect, 2, getAt(testRect, 2) - the stageTop - 1)
setAt(testRect, 3, getAt(testRect, 3) - the stageLeft + 1)
setAt(testRect, 4, getAt(testRect, 4) - the stageTop + 1)
else
set testRect to rect(5, 5, 0, 0)
end if
if active then
set inRegion to 0
repeat with i = 1 to count(regionList)
set regionRect to getAt(getAt(regionList, i), 1)
if (currH > getAt(regionRect, 1)) and (currH < getAt(regionRect, 3)) and (currV > getAt(regionRect, 2)) and (currV < getAt(regionRect, 4)) and not inside(point(currH, currV), testRect) then
set the locH of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 1)
set the locV of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 2)
if the mouseDown then
set the memberNum of sprite dynamicSprite to getAt(getAt(regionList, i), 4)
else
set the memberNum of sprite dynamicSprite to getAt(getAt(regionList, i), 3)
end if
set the visible of sprite dynamicSprite to 1
set gButUpdated to 1
set inRegion to 1
exit repeat
end if
end repeat
if inRegion = 0 then
set the visible of sprite dynamicSprite to 0
updateStage()
end if
else
set the visible of sprite dynamicSprite to 0
updateStage()
end if
end
on buttonMouseUp me
global gButMovie, gButFrame, gButRegionLists, gButCalled
if not listp(regionList) then
return
end if
set currH to the mouseH
set currV to the mouseV
if active then
if voidp(gButCalled) then
set gButCalled to 0
end if
if gButCalled = 1 then
return
end if
set inRegion to 0
repeat with i = 1 to count(regionList)
set regionRect to getAt(getAt(regionList, i), 1)
if (currH > getAt(regionRect, 1)) and (currH < getAt(regionRect, 3)) and (currV > getAt(regionRect, 2)) and (currV < getAt(regionRect, 4)) then
set the locH of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 1)
set the locV of sprite dynamicSprite to getAt(getAt(getAt(regionList, i), 2), 2)
set the memberNum of sprite dynamicSprite to getAt(getAt(regionList, i), 3)