Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
RADStingList (Free Version)
Flash Movie Controls
Lingo Sorcery
Dress Up
Using Director 7 (Special Edition)
Director 8 Primer
USBXtra
Direct FTP 2.0
Audio Xtra
JTMR KoolMarquee
 

 

 

Behavior Custom Scroll Bars

Added on 2/15/2000

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: Macromedia (website)

From Technote #13956 at Macromedia.com

property myTarget, myDirection, mySpeed
property myMinScroll, myMaxScroll, IamActive

on beginSprite me
  if myDirection = "Up" then mySpeed = -mySpeed
  myTarget = member(myTarget)
  if myTarget.type = #empty then alert "Looks like you renamed your castmembers."
  myMinScroll = 0
  myMaxScroll = charPostoloc(myTarget, myTarget.text.length).locV
end


on mouseDown me
  IamActive = TRUE
end

on prepareFrame me
  if IamActive then
    if the mouseUp then IamActive = FALSE
    newScroll = min(max(myMinScroll, myTarget.scrollTop + mySpeed), myMaxScroll)
    myTarget.scrolltop = newScroll
  end if
end

on getPropertyDescriptionList me
  theProps = [:]
  
  eligibleMembers = []
  repeat with i = 1 to the lastChannel
    case sprite(i).member.type of
      #field, #text:
      otherwise: next repeat
    end case
    if sprite(i).member.boxtype = #fixed then
      add eligibleMembers, sprite(i).member.name
    end if
  end repeat
  
  c = "Which text box to scroll?"
  addProp theProps, #myTarget, [#comment:c, #format:#string, #range: eligibleMembers, #default: 1]
  
  c = "How many pixels to scroll per frame?"
  r = [#min: 1, #max: 20]
  addProp theProps, #mySpeed, [#comment:c, #format: #integer, #range:r, #default: 2]
  
  c = "Which way does this button scroll?"
  r = ["Up", "Down"]
  addProp theProps, #myDirection, [#comment:c, #format: #string, #range:r, #default: "Down"]
  
  return theProps
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail