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
goMail LDM
Valentina
Scroll Thumb Track
Slide show
Field Entry Dialog Box
SpriTec Xtra! - Export your Cast and Score
Amara Flash Intro and Banner Builder
Text X-Changer
base64 encode/decode v1.2
Limited Text Behavior
 

 

 

Behavior Simple Distance Blend

Added on 4/18/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: MediaMacros (website)

This is a basic blend routine. Drop it on a sprite and it will blend in and out based upon the distance the mouse is from the sprite.

property maxDistance, spriteNum

on exitFrame me
  distance = sqrt(power((the mouseH - sprite(spriteNum).locH), 2) + power((the mouseV - sprite(spriteNum).locV), 2))
  if distance < maxDistance then
    theBlend = 100 - (100 * (float(distance) / maxDistance))
    sprite(spriteNum).blend = theBlend
  else
    sprite(spriteNum).blend = 0
  end if
end

on getPropertyDescriptionList me
  p_list = [#maxDistance : [#format : #integer, #comment : "Max distance from the sprite"s reg point:", #default : 200]]
  return p_list
end

on getBehaviorDescription me
  return "This is a basic blend routine.  Drop it on a sprite and it will blend in and out based upon the distance the mouse is from the sprite."
end

 


Contact

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

Send e-mail