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
Inspect
Saving Data in Shockwave
Special Edition Using Macromedia Director 8
Sound Slidebar
asFFTFile
Pad Number with Zeros
RADStingList (Free Version)
Version
De-Xplode that text position relative
TaskXtra
 

 

 

Behavior Ripple Follow Sprite-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Required Xtras:
Alphamania
Effector Set II for Alphamania

This item has not yet been rated

Author: MediaLab (website)

Requires Effector Set 2

property sNum
property postLength
property frameCount
property rippleSprite
property onlyWhileMouseOver

on getBehaviorDescription me
  return "This behavior will place ripples at another sprites location. The result is a water ski effect."
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #rippleSprite, [#comment: "Sprite To Follow:", #format: #integer, #default: 1]
  --addProp list, #postLength, [#comment: "Exit Delay:", #format: #integer, #default: 100, #range: [#max: 1000, #min:1]]
  addProp list, #onlyWhileMouseOver , [#comment: "Only While Mouse Over", #format: #boolean, #default: FALSE]
  return list
end

on beginSprite me
  set sNum = the spriteNum of me
  set frameCount = postLength
  ripple(sprite sNum)
  if onlyWhileMouseOver then
    if not rollover(sNum) then
      PauseEffect(sprite sNum, #ripple)
      exit
    end if
  end if
  Add(the actorList, me)
end

on endSprite me
  set pos =   getone(the actorList, me)
  if pos then
    deleteAt(the actorList, pos)
  end if
end


on stepFrame me
  -- could possibly check for intersection.  
  set x = (the locH of sprite rippleSprite) - (the left of sprite sNum)
  set y = (the locV of sprite rippleSprite) - (the top of sprite sNum)
  ripple(sprite sNum, [xLocation:x, yLocation:y])
end



on StopEffect me, sym
  -- removes this behavior from the actorList
  if not voidP(sym) then
    if sym <> #ripple then exit
  end if
  set pos =   getone(the actorList, me)
  if pos then
    deleteAt(the actorList, pos)
    PauseEffect(sprite sNum, #ripple)
  end if
end

on ResumeEffect me, sym
  -- adds this behavior to the actorList
  if not voidP(sym) then
    if sym <> #ripple then exit
  end if
  set pos =   getone(the actorList, me)
  if pos = 0 then
    Add(the actorList, me)
    ContinueEffect(sprite sNum, #ripple)
  end if
end

on mouseEnter me
  if onlyWhileMouseOver then
    ResumeEffect(me)
  end if
end

on mouseLeave me
  if onlyWhileMouseOver then
    StopEffect(me)
  end if
end

 


Contact

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

Send e-mail