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
Director Online
SWFText - Flash Text Animation Builder to make Flash Intro and Banner with 180+ Effects
CPS Audio/MIDI Xtra
Magic Button
Check QuickTime Version
myCDROM
Animated Cursor
Exploding Text Prepare Movie
Sortem
Dean Utian's Director Resources
 

 

 

Behavior Roil Button-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 speed
property stretch
property overMe
property actionType, actionText -- what to do or where to go

on getBehaviorDescription me
  return "A simple button behavior that applies roil when the user clicks. "
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #speed, [#comment: "Speed:", #format: #integer, #default: 7, #range: [#max: 20, #min:0]]
  addProp list, #stretch, [#comment: "Stretch:", #format: #integer, #default: 6, #range: [#max: 8, #min:0]]
  addProp list, #actionType, [#comment: "Action Type:", #format: #symbol, #range: [#goToFrame, #doLingo], #default: #doLingo]
  addProp list, #actionText, [#comment: "Action Text:", #format: #string, #default: "beep()"]
  return list
end

on beginSprite me
  set sNum = the spriteNum of me
  set overMe = -1
end

on ApplyRoil me
  roil(sprite sNum, [#speed: speed, #stretch: stretch])
end

on RemoveRoil me
  removeEffect(sprite sNum, #roil)
end

on mouseDown me
  set overMe = TRUE
  applyRoil(me)
  updateStage
end

on mouseEnter me
  if the stillDown and overMe = FALSE then
    applyRoil(me)
    set overMe = TRUE
  end if
end

on mouseLeave me
  if the stillDown and overMe = TRUE then
    RemoveRoil(me)
    set overMe = FALSE
  end if
end

on mouseUp me
  if overMe = TRUE then
    RemoveRoil(me)
    set overMe = FALSE
    
    action(me)
    updateStage
  end if
  set overMe = -1
end

on mouseUpOutside me
  set overMe = -1
end

on action me
  if actionType = #goToFrame then
    if value(actionText) > 0 then
      go to frame value(actionText) -- go to frame number
    else
      go to frame actionText -- go to frame label
    end if
  else if actionType = #doLingo then
    do actionText
  end if
end

 


Contact

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

Send e-mail