This applies to slider button sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings the slider button interactivity. The slider button graphics must be of bitmap, shape or vector-shape type.
on getBehaviorDescription
return "This applies to slider button sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings the slider button interactivity. The slider button graphics must be of bitmap, shape or vector-shape type."
end
on isOKtoAttach me, spriteType, spriteNum
case spriteType of
#graphic:
meType = sprite(spriteNum).member.type
return meType = #bitmap or meType = #shape or meType = #vectorShape
#script:
return FALSE
end case
end
on beginSprite me
pFlagA = FALSE
pFlagB = FALSE
pTextSpriteNum = 1 -- the number of the refering scrolled text/field sprite
pSliderSpriteNum = 3 -- number of the refering slider sprite
pMeSpriteNum = me.spriteNum
pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
pMeMemberNum = sprite(pMeSpriteNum).memberNum
pMeOrigPos = sprite(pMeSpriteNum).locV
pMeMaxShift = pMeOrigPos + sprite(pSliderSpriteNum).pMeHeight
pMeStep = 1 / sprite(pSliderSpriteNum).pMeStep
pLineH = sprite(pTextSpriteNum).pMeLineH
end
on mouseDown me
pFlagB = TRUE
end
on mouseUp me
pFlagB = FALSE
end
on mouseWithin me
sprite(pMeSpriteNum).member = member(pMeMemberNum + 1, pMeCastLibNum)
pFlagA = TRUE
end
on mouseLeave me
if pFlagB = FALSE then
sprite(pMeSpriteNum).member = member(pMeMemberNum, pMeCastLibNum)
pFlagA = FALSE
end if
end
on mouseUpOutside me
sprite(pMeSpriteNum).member = member(pMeMemberNum, pMeCastLibNum)
pFlagA = FALSE
pFlagB = FALSE
end
on prepareFrame me
if pFlagB = TRUE and the mouseUp = TRUE then
pFlagB = FALSE
end if
if pFlagA = FALSE then
sprite(pMeSpriteNum).locV = pMeOrigPos + sprite(pSliderSpriteNum).pShift
else
if pFlagB = TRUE then dragProcedure
end if
end
on dragProcedure
A = the mouseV
if A < pMeOrigPos then B = pMeOrigPos
if A > pMeMaxShift then B = pMeMaxShift
if A >= pMeOrigPos and A <= pMeMaxShift then B = A
sprite(pMeSpriteNum).locV = B
sprite(pTextSpriteNum).member.scrollTop = (pMeStep * (B - pMeOrigPos) / pLineH).integer * pLineH
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA