|
Scroll the text to make the movie jump to a marker as determined by the
line beneath the yellow rectangle. The movie is actually going to markers
as reflected by the frameLabel status line at the bottom.
When dropped on a scroll button, this behavior will bring up a dialog
box in which you enter the #text sprite, the locH, and the locV which
the behavior will use in determining which line is under the rectangle.
The behavior for this example, underWhichLine, is shown below.
|
|
The Lingo:
(Syntax highlighting provided by David Mennenoh's way cool HTML-ingo utility).
-- Behavior name: underWhichLine
-- Written by Mark A. Boyd
-- 20-May-00 Public Domain
property targetSprite
property pLocH
property pLocV
property pLocPoint
on beginSprite me
-- convert the numbers given in the GPDL to a point
pLocPoint = point(pLocH,pLocV)
end
-- This is really all there is to the code. The majority of
-- this behavior consists of creating the GPDL
on mouseUp me
lineNum = pointToLine(sprite(targetSprite),pLocPoint)
theLabel = sprite(targetSprite).member.line[lineNum]
go to theLabel
end
-- the GPDL
on getPropertyDescriptionList me
if the currentSpriteNum = 0 then exit
pList = [:]
lTextSprites = []
repeat with i = 1 to the lastChannel
if sprite(i).member.type = #text then
lTextSprites.append(i)
end if
end repeat
if lTextSprites.count < 1 then
alert "This behavior requires a #Text sprite."
exit
end if
pList.addProp(#pLocH,[¬
#comment:"Horizontal location:",¬
#format:#integer,¬
#default:190])
pList.addProp(#pLocV,[¬
#comment:"Vertical location:",¬
#format:#integer,¬
#default:180])
pList.addProp(#targetSprite,[¬
#comment:"Text sprite:",¬
#format:#integer,¬
#default:lTextSprites[1],¬
#range:lTextSprites])
return pList
end
|