if the currentspritenum = 0 then
set butdefault = []
set speeddefault = 0
else
set butdefault = string(the currentSpriteNum + 1)
set speeddefault = 10
end if
addprop description, #holdOnMouseDown, ¬
[#default:true,#format:#boolean,#comment:"Fixed while mousedown:"]
return description
end getPropertyDescriptionList
--------
on beginSprite me
set buttonList = stringToList(buttonString)
set the backSprite of me = the spriteNum of me
set the barBox of me = the rect of sprite backSprite
put the backSprite of me + 1 into firstBut
set the inLoc of me = the loc of sprite the backSprite of me
initDir me
return me
end
on initDir me
put the frameTempo into tempo
put the stageBottom - the stageTop into stageHeight
put the stageRight - the stageLeft into stageWidth
case (the direction of me) of
#bottom:
put "the locV of sprite" && backSprite && ">" && the locV of inLoc into onStageTest
put "the top of sprite" && backSprite && "<" && stageHeight into offStageTest
if speed = 0 then
put (the stageBottom - the top of sprite backSprite) into roll
else put speed into roll
put point(0,roll) into rollSpeed
set mouseTest = "the mouseV >" && the top of sprite backSprite
#left:
put "the locH of sprite" && backSprite && "<" && the locH of inLoc into onStageTest
put "the right of sprite" && backSprite && ">" && 0 into offStageTest
if speed = 0 then
put the right of sprite backSprite into roll
else put speed into roll
put point(- roll,0) into rollSpeed
set mouseTest = "the mouseH <" && the right of sprite backSprite
#top:
put "the locV of sprite" && backSprite && "<" && the locV of inLoc into onStageTest
put "the bottom of sprite" && backSprite && ">" && 0 into offStageTest
if speed = 0 then
put the bottom of sprite backSprite into roll
else put speed into roll
put point(0,- roll) into rollSpeed
set mouseTest = "the mouseV <" && the bottom of sprite backSprite
#right:
put "the locH of sprite" && backSprite && ">" && the locH of inLoc into onStageTest
put "the left of sprite" && backSprite && "<" && stageWidth into offStageTest
if speed = 0 then
put (the stageRight - the left of sprite backSprite) into roll
else put speed into roll
put point(roll,0) into rollSpeed
set mouseTest = "the mouseH >" && the left of sprite backSprite
end case
if mouseDetect = #area then set mouseTest = "inside(point(the mouseH, the mouseV), barBox)"
end
on prepareframe me
if value(mouseTest) then
moveIn me
else moveOut me
end
on moveOut me
if holdOnMouseDown and the mouseDown then
-- hold buttonbar onstage
else
if value(offStageTest) then
set the loc of sprite backSprite to rollSpeed + the loc of sprite backSprite
repeat with i in buttonlist
set the loc of sprite i to rollSpeed + the loc of sprite i
end repeat
end if
end if
end
on moveIn me
set onStage = value(onStageTest)
if onStage then
set the loc of sprite backSprite to - rollSpeed + the loc of sprite backSprite
repeat with i in buttonlist
set the loc of sprite i to - rollSpeed + the loc of sprite i
end repeat
end if
end
on stringToList spritestring
set newList = []
do "set newList = [" & spritestring & "]"
return newList
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA