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
Fix Bad Scripts
Orbiter
Screen grab to castmember
Tool Tips/Help popUp box ver 2.1
ScreenCapture
Imaging Lingo - Hyporoid Illusion
Windows NT and Audio
XTRA dmmScript for scripting
simPPTViewer1.0 Xtra
Set ButtonsEnabled Property of a Flash Cast member
 

 

 

Behavior ZGTSB-Slider Button

Added on 5/22/2001

 

Compatibilities:
behavior D8 D8_5 Mac PC Shockwave

This item has not yet been rated

Author: Ziggi

This applies to slider button sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings the slider button interactivity. The slider button graphics must be of bitmap, shape or vector-shape type.

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

property pMeOrigPos, pMeMaxShift, pMeSpriteNum, pMeCastLibNum, pMeMemberNum, pSliderSpriteNum
property pTextSpriteNum, pFlagA, pFlagB, pMeStep, pLineH

on getBehaviorDescription
  return "This applies to slider button sprite of the 'Ziggi Generic Text Scrolling Behaviours' set and brings the slider button interactivity. The slider button graphics must be of 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
  pFlagA = FALSE
  pFlagB = FALSE
  pTextSpriteNum = 1 -- the number of the refering scrolled text/field sprite
  pSliderSpriteNum = 3 -- number of the refering slider sprite
  pMeSpriteNum = me.spriteNum
  pMeCastLibNum = sprite(pMeSpriteNum).castLibNum
  pMeMemberNum = sprite(pMeSpriteNum).memberNum
  pMeOrigPos = sprite(pMeSpriteNum).locV
  pMeMaxShift = pMeOrigPos + sprite(pSliderSpriteNum).pMeHeight
  pMeStep = 1 / sprite(pSliderSpriteNum).pMeStep
  pLineH = sprite(pTextSpriteNum).pMeLineH
end

on mouseDown me
  pFlagB = TRUE
end

on mouseUp me
  pFlagB = FALSE
end

on mouseWithin me
  sprite(pMeSpriteNum).member = member(pMeMemberNum + 1, pMeCastLibNum)
  pFlagA = TRUE
end

on mouseLeave me
  if pFlagB = FALSE then
    sprite(pMeSpriteNum).member = member(pMeMemberNum, pMeCastLibNum)
    pFlagA = FALSE
  end if
end

on mouseUpOutside me
  sprite(pMeSpriteNum).member = member(pMeMemberNum, pMeCastLibNum)
  pFlagA = FALSE
  pFlagB = FALSE
end

on prepareFrame me
  if pFlagB = TRUE and the mouseUp = TRUE then
    pFlagB = FALSE
  end if
  if pFlagA = FALSE then
    sprite(pMeSpriteNum).locV = pMeOrigPos + sprite(pSliderSpriteNum).pShift
  else
    if pFlagB = TRUE then dragProcedure
  end if
end

on dragProcedure
  A = the mouseV
  if A < pMeOrigPos then B = pMeOrigPos
  if A > pMeMaxShift then B = pMeMaxShift
  if A >= pMeOrigPos and A <= pMeMaxShift then B = A
  sprite(pMeSpriteNum).locV = B
  sprite(pTextSpriteNum).member.scrollTop = (pMeStep * (B - pMeOrigPos) / pLineH).integer * pLineH
end  

 


Contact

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

Send e-mail