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
Generic Countdown Timer
Flash Movie Controls
APresentationTrakker Xtra
Play/Pause/Rewind a Animated Gif Sprite
Write a file
123 Flash Menu
Tracking save attempts
Get Member Modified Time and Date
AppSafe Xtra for Authorware and Director
Check For Qt Version
 

 

 

Behavior Bouncing Bevel Light-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 bevel
property red, green, blue
property strength
property crop
property rad
property speed -- how fast light moves
property x, y -- light coordinates
property dx, dy -- movement in x and y directions
property spriteHeight, spriteWidth -- dimensions of sprite

on getBehaviorDescription me
  return "Creates a static bevel and then constantly changes the light coordinates."
end

on getPropertyDescriptionList me
  set list = [:]
  addProp list, #speed, [#comment: "Speed:", #format: #integer, #default: 5, #range: [#max: 25, #min:0]]
  addProp list, #bevel, [#comment: "Bevel:", #format: #integer, #default: 5, #range: [#max: 25, #min:0]]
  addProp list, #red, [#comment: "Red:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #green, [#comment: "Green:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #blue, [#comment: "Blue:", #format: #integer, #default: 255, #range: [#max: 255, #min:0]]
  addProp list, #strength, [#comment: "Strength:", #format: #integer, #default: 0, #range: [#max: 255, #min:0]]
  addProp list, #rad, [#comment: "Radius:", #format: #integer, #default: 100, #range: [#max: 255, #min:0]]
  return list
end

-- apply the bevel effect
on beginSprite me
  set sNum = the spriteNum of me
  set spriteWidth = the width of sprite sNum
  set spriteHeight = the height of sprite sNum
  set x = 0
  set y = 0
  set dx = -1
  set dy = -1
  bevel(sprite sNum, [#animMode: #static, #bevel: bevel, #red: red, #green: green, #blue: blue, #strength: strength, #radius: rad])
end

-- update light location if needed
on setLight me
  set x = x + dx*speed
  set y = y + dy*speed
  if (x > spriteWidth/2) then set dx = -dx
  if (x < -spriteWidth/2) then set dx = -dx
  if (y > spriteHeight/2) then set dy = -dy
  if (y < -spriteHeight/2) then set dy = -dy
  
  bevel(sprite sNum, [#lightLocX: integer(x), #lightLocY: integer(y)])
end

on enterFrame me
  setLight(me)
end

 


Contact

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

Send e-mail