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
Vector Shapes - Create Donut
Check for DirectShow Installation
Audio Xtra
Help Studio 2000
Atom
Cuberoids
Marks button, 4 picts with rollover, rolloff
Easy to use video convertor
markerXtra
Bilinear Resample Algorithm
 

 

 

Behavior ZGTSB-ButtonDown

Added on 5/22/2001

 

Compatibilities:
behavior D8 D8_5 Mac PC Shockwave

This item has not yet been rated

Author: Ziggi

Button Down Script for text scrolling.

Download PC Source    Download Mac Source
-- ZIGGI GENERIC TEXT SCROLLING BEHAVIOURS --
-- (C) 2001 Zbigniew Szczesny

property pMeSpriteNum , pMeMemberNum, pMeCastLibNum, pMeWasDown, pMeTime, pMeWasFast

on getBehaviorDescription
  return "This applies to the 'Scroll-Down' button sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and the button must be of a bitmap, shape or vector-shape type."
end

on isOKtoAttach me, spriteType, spriteNum
  case spriteType of
    #graphic:
      meType = sprite(spriteNum).member.type
      return meType = #bitmap or meType = #shape or meType = #vectorShape
    #script:
      return FALSE
  end case
end

on beginSprite me
  pMeWasDown = FALSE
  pMeWasFast = FALSE
  pMeSpriteNum = me.spriteNum
  pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
  pMeMemberNum = sprite(pMeSpriteNum).memberNum
end

on mouseEnter me
  sprite(pMeSpriteNum).member = member(pMeMemberNum + 1, pMeCastLibNum)
end

on mouseLeave me
  sprite(pMeSpriteNum).member = member(pMeMemberNum, pMeCastLibNum)
end

on mouseDown me
  pMeWasDown = TRUE
  pMeWasFast = FALSE
  sprite(pMeSpriteNum).member = member(pMeMemberNum + 2, pMeCastLibNum)
end

on mouseUp me
  pMeWasDown = FALSE
  sprite(pMeSpriteNum).member = member(pMeMemberNum + 1, pMeCastLibNum)
  if pMeWasFast = FALSE then slide
end

on mouseWithin me
  if the stillDown and pMeWasDown = TRUE and the lastClick > 15 then
    pMeWasFast = TRUE
    slideMore
  end if
end

on slide
  sendSprite(1, #scrollDown)
  sendSprite(2, #scrollDown)
end

on slideMore
  sendSprite(1, #scrollDownMore)
  sendSprite(2, #scrollDownMore)
end  

 


Contact

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

Send e-mail