property pWithin -- mouse is in the menu, or not property pLineHeight -- the height of each line of the text member property pRect -- the rectangle of the text member property pSprite -- the indicator sprite for the highlighting effect property pSpriteOrigin -- the "snap-back" location of the highlighter sprite property pMember -- the text cast member to be used as a menu property pLeftPos -- the left position of the indicator property pTextTop -- the top position of the text member on beginSprite me pLineHeight = member(sprite(me.spriteNum).member.name).fixedLineSpace pTextTop = sprite(me.spriteNum).rect[2] - pLineHeight / 2.75 -- adjust vertical position of indicator end -- ********** Note: 05-27-10 ********** -- This behavior still needs some work to handle the positioning of the "floater" artwork over the top -- of the selected text line from the text cast member. By changing the '2.75' value above, and changing -- the line height and 'leftmost' property you can get the "floater" sprite to line up correctly. -- As-is the behavior will correctly return the text from the line clicked. It is only the cosmetics -- of getting the "floater" to work consistently that still needs work. ************************************ -- -- Simple text menu behavior. Requires a text cast member with text on each line -- that matches the text in markers within the movive, and a sprite to act as a -- highlighter that will snap to the line positions within the menu as the -- mouse moves. This behavior should be attached to a text cast member that -- is to be used as a menu. -- -- Ken Loge - http://diginoodles.com -- on getPropertyDescriptionList me list = [:] addProp list, #pMember, [#comment: "Text cast member to use as a menu:", #format: #text, #default: "menu"] addProp list, #pSprite, [#comment: "Highlighter sprite number:", #format: #integer, #default: "3"] addProp list, #pSpriteOrigin, [#comment: "Point of origin for highlighter sprite:", #format: #point, #default: point(313, 512)] addProp list, #pLeftPos, [#comment: "Leftmost position of the highlighter sprite:", #format: #integer, #default: 313] return list end on mouseUp me -- get the text from the line that was clicked in the field pointClicked = _mouse.mouseLoc lineNum = sprite(me.spriteNum).pointToLine(pointClicked) lineText = sprite(me.spriteNum).member.line[lineNum] -- go to a marker with the same name as the text clicked if lineText <> EMPTY then _movie.go(lineText) end if end -- the mouse is within the text field on mouseEnter me pWithin = TRUE cursor 280 -- switch to finger cursor end -- reset indicator sprite on mouseLeave me sprite(pSprite).loc = pSpriteOrigin cursor -1 -- switch to normal arrow cursor pWithin = FALSE end -- move indicator sprite with mouse on exitFrame me if pWithin = TRUE then -- get the line number the mouse is over in the text field lineNum = sprite(me.spriteNum).pointToLine(_mouse.mouseLoc) -- make sure the line number is valid if lineNum > 0 then -- move indicator sprite to line locations within the menu sprite(pSprite).loc = point(pLeftPos, pTextTop + (lineNum * pLineHeight)) end if end if end