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
Print a file with associated program
GetInfoFromAIFF
USBXtra
CPS Audio/MIDI Xtra
Prepare for movie (Sound Card and Screen Saver Check)
Change bitmap brightness and contrast behaviour
Set Linked Property of a Flash member
Wait For Frame Ready
DumpSymbol
DM Transition Pack 1
 

 

 

Behavior Bevel Button-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: MediaLab (website)

Requires Effector Set 2. These behaviors are for use with the Alphamania Xtra and its add-on effector sets.

property sNum
property overMe
property bevel
property pressDepth -- how deep the bevel effect should go
property moveMode -- whether in up or down part of animation
property frameCount -- how much time left in this part of animation
property actionType, actionText -- what to do or where to go

on getBehaviorDescription me
  return "A simple button behavior that plays a bevel animation when the user clicks. The bevel crop shrinks. This creates a "push" effect."
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #bevel, [#comment: "Bevel:", #format: #integer, #default: 5, #range: [#max: 25, #min:1]]
  addProp list, #pressDepth, [#comment: "Press Depth:", #format: #integer, #default: 128, #range: [#max: 255, #min:0]]
  addProp list, #actionType, [#comment: "Action Type:", #format: #symbol, #range: [#goToFrame, #doLingo], #default: #doLingo]
  addProp list, #actionText, [#comment: "Frame Name or Handle Name:", #format: #string, #default: "beep()"]
  return list
end

on beginSprite me
  set frameCount = 10
  set moveMode = VOID
  set overMe = -1
  set sNum = the spriteNum of me
  bevel(sprite sNum, [#animMode: #static, #bevel: bevel, #bevCrop: 255])
end

on mouseDown me
  set overMe = TRUE
  bevel(sprite sNum, [animMode:#range, numFrames:frameCount, startBevCrop:255, endBevCrop: pressDepth])
  updateStage
end

on mouseEnter me
  if the stillDown and overMe = FALSE then
    bevel(sprite sNum, [animMode:#range, numFrames:frameCount, endBevCrop:pressDepth])
    set overMe = TRUE
  end if
end

on mouseLeave me
  if the stillDown and overMe = TRUE then
    bevel(sprite sNum, [animMode:#range, numFrames:frameCount, endBevCrop:255])
    set overMe = FALSE
  end if
end

on mouseUp me
  if overMe = TRUE then
    bevel(sprite sNum, [animMode:#static, bevCrop:255])
    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