Creates a button that scrolls left or right when clicked, to display text.
Reproduced with permission from Penworks Lingo User"s Journal
property memberListField
property face
property forwardList
property backwardList
on beginSprite me
set face = 1
createLists me
return me
end
on mouseUp me
if the mouseH < the locH of sprite the spriteNum of me then
animate me, #forward
else animate me, #backward
end
on animate me, whichWay
puppetSprite 1, TRUE
if whichWay = #forward then
set memberLIst to getAt (forwardList, face)
set face to face + 1
if face > count (forwardList) then
set face to 1
end if
else
set memberLIst to getAt (backwardList, face)
set face to face - 1
if face = 0 then set face to count (forwardList)
end if
repeat with theMember in memberList
set the member of sprite the spriteNum of me to theMember
set delay = the ticks + 5
repeat while the ticks < delay
end repeat
updateStage
end repeat
end animate
on createLists me
set memberList = value (field memberListField)
set forwardList = getProp (memberList, #forwardList)
set backwardList = getProp (memberList, #backwardList)
end createLists
on face
return face
end
on getPropertyDescriptIonList
set propDesc = [:]
-- set defaultField = the number of member "Revolving button list"
set defaultField = "Revolving button list"
addProp propDesc, #memberListField, ¬
[¬
#comment: "Field member containing the list"&RETURN&" of members for this button:",¬
#format: #string, ¬
#default: defaultField ¬
]
return propDesc
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA