Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
AppActive
Sprite Drag - Confine to stage
KeyPoll
Send E-mail using Buddy API
Flash Sprite -- Simple Controller [Play, Pause, Rewind]
Popup Menu ActiveX Control
Slider behaviour v2.2
Change Bitdepth
Arca Database Xtra
RotateWithSound
MediaMacros Xtras Mall
 

 

 

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

 


Upload Provided by ABCUpload ASP

Contact

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

Fax - (206) 339-5833

Send e-mail