Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Sound slider
Generic behavior to change System Cursors
Reshacker
cXtraTwain
Magnify-Alphamania
Button Animator on how close cursor is to it
VCap
get and set a mp3's ID3tag I !
Wait for X seconds, go to marker
Set BroadCast Property of a Flash Sprite
MediaMacros Xtras Mall
 

 

 

Behavior Ripple Button-Alphamania

Added on 6/10/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

Required Xtras:
Alphamania
Effector Set I for Alphamania

This item has not yet been rated

Author: MediaLab (website)

Requires Effector Set 2

property sNum
property height
property actionType, actionText -- what to do or where to go
property overMe
property delay
property mode

on getBehaviorDescription me
  return "A simple button behavior that places a ripple in the sprite when the user clicks."
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #mode, [#comment: "Ripple From:", #format: #symbol, #range: [#mouse, #center], #default: #center]
--  addProp list, #height, [#comment: "Height:", #format: #integer, #default: 400, #range: [#max: 2000, #min:1]]
  addProp list, #delay, [#comment: "Delay Frames:", #format: #integer, #default: 15, #range: [#max: 120, #min:1]]
  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 overMe = -1
  set sNum = the spriteNum of me
  set frameCount = VOID
  ripple(sprite sNum)
  PauseEffect(sprite sNum, #ripple)
end

on mouseDown me
  set overMe = TRUE
  if mode = #center then
    set x = (the width of sprite sNum)/2
    set y = (the height of sprite sNum)/2
  else
    set x = the mouseH - the left of sprite sNum
    set y = the mouseV - the top of sprite sNum
  end if
  ripple(sprite sNum, [#xLocation: x, #yLocation: y])
end

on mouseEnter me
  if the stillDown and overMe = FALSE then
    if mode = #center then
      set x = (the width of sprite sNum)/2
      set y = (the height of sprite sNum)/2
    else
      set x = the mouseH - the left of sprite sNum
      set y = the mouseV - the top of sprite sNum
    end if
    ContinueEffect(sprite sNum, #ripple)
    ripple(sprite sNum, [#xLocation: x, #yLocation: y])
    set overMe = TRUE
  end if
end

on mouseWithin me
  if mode <> #center and the stillDown and overMe = TRUE then
    set x = the mouseH - the left of sprite sNum
    set y = the mouseV - the top of sprite sNum
    ripple(sprite sNum, [#xLocation: x, #yLocation: y])
  end if
end

on mouseLeave me
  if the stillDown and overMe = TRUE then
    PauseEffect(sprite sNum, #ripple)
    set overMe = FALSE
  end if
end

on mouseUp me
  if overMe then
    set overme = -1
    repeat with x = 1 to delay
      updateStage
    end repeat
    
    Removeeffect(sprite sNum, #ripple)
    ripple(sprite sNum)
    PauseEffect(sprite sNum, #ripple)
    
    action(me)
  end if
end

on mouseUpOutside me
  Removeeffect(sprite sNum, #ripple)
  ripple(sprite sNum)
  PauseEffect(sprite sNum, #ripple)
  
  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

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail