Mark A. Boyd's

[MBlogo Animation]  mboyd.com  [MBlogo Animation]

underWhichLine.dcr

[myDirector] [Home]

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.

March 22, 2009

It has come to my attention recently (March 2009) that due to my recent use of Adobe's user-to-user support forums, I may have unwittingly granted a license to Adobe to use the content on this page in, pretty much, any manner they wish according to their current (as of this writing) Terms of Use.

Now, it is a stretch, since if I did post links to this page, it would have been many years ago and on, at that time, Macromedia's NNTP news server. But now that Adobe owns the server and the database that Macromedia's Web-based application used in conjunction with that server, I have decided to play on the safe side. There's even a chance that I only posted a link in an email to some other party's ListServ. Still, I feel I must do what I can to ensure that I am not responsible for any violations of the copyright owner's rights.

Part of the content I provided on this page was a Shockwave .dcr that contained, with permission (see below), behavior scripts copyrighted by somebody else. Since I am in no position to grant license or rights for that content to Adobe or anybody else, I have moved this content elsewhere.

If you came to this page looking for help doing what it says, then I highly recommend visiting other Director-related sites for better, more up-to-date methods. This one is quite ancient and not really of much use to anybody. Especially since it was created in order to help somebody solve a rather unique problem. Furthermore, since it was compressed as a Shockwave .dcr it is not editable within Director. (This was done specifically to help protect the rights of the author of some scripts used in the example.)

If you do want access to this content, use my contact form to ask me where to get underWhichLine.dcr

Director 7 scripts. To use with D8 or higher replace all ¬ characters with \.

This example uses behaviors copyrighted by Pat McClellan for the scroll buttons. Pat has made them free use for readers of Director Online's "The Multimedia Handyman". Visit Director Online at http://www.director-online.com

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


Home