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
Using Director 7 (Special Edition)
Puzzler II - Slide Puzzle
Convert between bases-Integer to String
Opening Local HTML pages
SceneList
Indeo Video
Go to net movie
Attr
Set ViewScale Property of a Flash Member
Message Box Behavior
 

 

 

Behavior Scrollable Sprites

Added on 6/7/1999

 

Compatibilities:
behavior D6_5 Mac PC

This item has not yet been rated

Author: PatMcClellan

For use with the Scroll Button Scroll Button, Scroll Thumb, and the Scroll Thumb Track behaviors This behavior allows the author to select direction for which the thumb (sprite) which will move when called by the ScrollButton behavior. It uses a global variable which is incremented by the ScrollButton behavior. NOTE: the motion of the sprite is opposite the direction of the scroll arrow and the scroll thumb.

property pMyRange        -- number of pixels that the sprite may move
property pMyIncrement    -- number of pixels that the thumb sprite will advance per click
property pMyStartV       -- initial locV of the thumb sprite
property pMyStartH       -- initial locH of the thumb sprite
global gScrollV          -- amount scroll has been incremented Vertically from initial value
global gScrollH          -- amount scroll has been incremented Horizontally from initial value

on getPropertyDescriptionList
  set directionList = [#HORIZONTAL, #VERTICAL]
  set p_list = [
  #pMyRange:    [ #comment:   "Range of motion (in pixels)",
  #format:   #integer,
  #default:   100]
  ]
  return p_list
end

on beginSprite me
  set pMyStartH = the locH of sprite the spriteNum of me
  set pMyStartV = the locV of sprite the spriteNum of me  
end

on setThumbH me, thumbRange, thumbSprite
  set pMyIncrement = pMyRange * 1.00/thumbRange
  set the locH of sprite the spriteNum of me = pMyStartH - integer(gScrollH * pMyIncrement)
end

on setThumbV me, thumbRange, thumbSprite
  set pMyIncrement = pMyRange * 1.00/thumbRange
  set the locV of sprite the spriteNum of me = pMyStartV - integer(gScrollV * pMyIncrement)
end

on scrollH me
  set the locH of sprite the spriteNum of me = pMyStartH - integer(gScrollH * pMyIncrement)
end

on scrollV me
  set the locV of sprite the spriteNum of me = pMyStartV - integer(gScrollV * pMyIncrement)
end

 


Contact

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

Send e-mail