return "CUSTOM SCROLL BAR" & RETURN & RETURN & "Create dynamic scrollbars with your own artwork. " & " Such scrollbars are not Direct-To-Stage, so other sprites can appear over the top of them." & RETURN & RETURN & "You will need to create four graphic members:" & RETURN & "+ up arrow" & RETURN & "+ down arrow" & RETURN & "+ dragger" & RETURN & "+ backing bar" & RETURN & RETURN & "You may wish to use two additional members, to indicate that the arrow buttons have been pressed:" & RETURN & "+ up arrow (pressed state)" & RETURN & "+ down arrow (pressed state)" & RETURN & RETURN & "Place the four standard members on the Stage, and drop this behavior onto each of them. " & " Choose how the current sprite is to act in the appropriate pop-up menu in the Behavior Parameters dialog." & RETURN & RETURN & "For each element you can choose whether animations should continue in the background. " & " This option will tend to slow both the animations and the scrolling process, especially if applied to the arrow buttons." & RETURN & RETURN & "The various sprites will position themselves automatically to the right of the sprite-to-be-scrolled when the movie runs. " & " They revert to their original positions when it stops. " & " To avoid flashes, it would be a good idea to position them by hand in their intended positions." & RETURN & RETURN & "If you use a border on your field members, the scrollbar will sit outside the border. " & " Field box shadows are not recommended. " & " You can always fake external borders and box shadows with shape members (this even gives you a choice of colors)." & RETURN & RETURN & "To make authoring easier, this behavior will continue to work if you change EITHER the sprite channel OR the member in the chosen channel. " & " If you change both, the behavior will no longer know what to scroll." & RETURN & RETURN & "If you do change either the sprite or the member, and then reopen the Behavior Parameters dialog for one of the elements, this will put that behavior out of synch with the others. " & " Simply reopen and close the Parameters dialogs for each of the other elements. " & " If you do not do so, you will receive multiple alerts." & RETURN & RETURN & "This behavior can be used to scroll both editable and non-editable Fields and Text members. " & " For editable members, however, it does not automatically update the dragger position when the length of the text changes, nor does it make the editable member scroll automatically when the user drags the mouse to create a selection." & RETURN & RETURN & "PERMITTED MEMBER TYPES:" & RETURN & "[#animGif, #bitmap, #filmLoop, #flash, #movie, #picture, #shape]" & RETURN & RETURN & "PARAMETERS:" & RETURN & "* Current sprite acts as (up|down arrow | dragger | bar)" & RETURN & "* Scroll the member of <sprite>: <the member of sprite>" & RETURN & "* Standard member (this should not need to be set)" & RETURN & "* Member to display when arrow buttons are pressed" & RETURN & "* Allow animations to continue" & RETURN & RETURN & "PUBLIC METHODS" & RETURN & "=> Scroll the text/field member to a given position" & RETURN & "=> Swap the text/field member to be scrolled" & RETURN & "=> Get the behavior reference"
end
on getBehaviorTooltip me
return "Use 4 graphic members (dragger, bar, up and down arrows)to create a dynamic scrollbar for Text or Field members." & RETURN & RETURN & "Drop this behavior on each sprite separately." & RETURN & RETURN & "Sprites can pass over the scrollbar and animations can continue while the user scrolls." & RETURN & RETURN & "The behavior accepts Lingo calls to:" & RETURN & "+ set the scrolltop of the scrolled member to a given value." & RETURN & "+ swap the current member of the sprite."
alert("Error: Please place a Field or Text member on the Stage before using this behavior to create a scroll bar." & RETURN & " " & RETURN & "Hit OK and then delete this behavior from the sprite." & RETURN & " " & RETURN & "For more information on deleting Behaviors, see the Help system.")
otherwise:
behaviorName = string(me)
delete word 1 of behaviorName
delete char -30001 of behaviorName
delete char -30001 of behaviorName
case data.ilk of
#void:
data = "<void>"
#symbol:
data = "#" & data
end case
if theError <> #getPDL_Invalid then
memberName = myScrolledMember.name
if memberName = EMPTY then
memberName = myScrolledMember
else
memberName = QUOTE & memberName & QUOTE
end if
memberName = myScrolledMember.type && memberName
end if
case theError of
#getPDL_Invalid:
message = substituteStrings(me, "BEHAVIOR ERROR: Frame ^0, Sprite ^1" & RETURN & " " & RETURN & "Parameters for the ^2 behavior have not been set." & RETURN & " " & RETURN & "Please reopen the Behavior Parameters dialog and choose again.", ["^0": the frame, "^1": me.spriteNum, "^2": behaviorName])
alert(message)
halt()
#notScrollable:
message = substituteStrings(me, "BEHAVIOR ERROR: Frame ^0, Sprite ^1" & RETURN & "Behavior ^2" & RETURN & " " & RETURN & "Sprite ^3 does not contain a Field or Text member." & RETURN & RETURN & "Choose again in the Behavior Parameters dialog." & RETURN & RETURN & "Member type = ^4", ["^0": the frame, "^1": me.spriteNum, "^2": behaviorName, "^3": myScrolledSprite.spriteNum, "^4": data])
alert(message)
halt()
#extraControl:
if the runMode = "Author" then
message = substituteStrings(me, "BEHAVIOR ERROR: Frame ^0, Sprite ^1" & RETURN & "Behavior ^2" & RETURN & " " & RETURN & "There is more than one ^3 sprite defined for the scroll bar for sprite ^4, ^5.", ["^0": the frame, "^1": me.spriteNum, "^2": behaviorName, "^3": data, "^4": myScrolledSprite.spriteNum, "^5": memberName])
alert(message)
halt()
end if
#missingControls:
message = substituteStrings(me, "BEHAVIOR ERROR: Frame ^0, Sprite ^1" & RETURN & "Behavior ^2" & RETURN & " " & RETURN & "The following elements of the scroll bar for sprite ^3, ^4 are missing:" & RETURN & " " & RETURN & "^5", ["^0": the frame, "^1": me.spriteNum, "^2": behaviorName, "^3": myScrolledSprite.spriteNum, "^4": memberName, "^5": data])
alert(message)
halt()
end case
end case
end
on substituteStrings me, parentString, childStringList