Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Getting full error messages
DirectTransition
TextCruncher
Behavior Killer behavior
Sprite Stick To Mouse Cursor
Drop Shadow Follow Mouse or Sprite-Alphamania
Foundation Flash 5
MagicTools Xtras
First Class Text Picture
Making Multiple Animated Buttons
MediaMacros Xtras Mall
 

 

 

Behavior Pulse Blend a Sprite

Added on 5/6/2008

 

Compatibilities:
behavior D8_5 D9 Mac PC Shockwave

This item has not yet been rated

Author: kenl (website)

Cyclically fades a sprite up and down when the sprite is rolled over.

   Download Mac Source
-- This behavior repeatedly makes a sprite fade and brighten
-- in opacity when the sprite is rolled over.
-- Works with any sprite that has a blend property.

-------------------------
-- Ken Loge 02-15-2002
-- http://dreamsteep.com
-------------------------

property pActivatePulseEffect -- whether the pulse effect is turned on or off
property pBlendValueState -- if the sprite is currently dimming or getting brighter
property pFadeStep -- the rate of the sprite blend change

on beginSprite me
  pBlendValueState = #getDimmer
  pActivatePulseEffect = FALSE
end

on getPropertyDescriptionList me
  list = [:]
  addProp list, #pFadeStep, [#comment: "Fade rate of sprite:", #format: #integer, #default: 5]
  return list
end

on exitFrame me
  pulseSprite(me)
end

on mouseEnter me
  if pActivatePulseEffect = FALSE then
    pActivatePulseEffect = TRUE
  else
    pActivatePulseEffect = FALSE
  end if
end

on mouseLeave me
  if pActivatePulseEffect = FALSE then
    pActivatePulseEffect = TRUE
  else
    pActivatePulseEffect = FALSE
    sprite(me.spriteNum).blend = 100
  end if
end

-- pulse blend a sprite cyclically using a simple state switcher
on pulseSprite me
  if pActivatePulseEffect = TRUE then
    if pBlendValueState = #getDimmer then
      sprite(me.spriteNum).blend = sprite(me.spriteNum).blend - pFadeStep
      if sprite(me.spriteNum).blend < pFadeStep then pBlendValueState = #getBrighter
    end if
    
    if pBlendValueState = #getBrighter then
      sprite(me.spriteNum).blend = sprite(me.spriteNum).blend + pFadeStep
      if sprite(me.spriteNum).blend > (100 - pFadeStep) then pBlendValueState = #getDimmer
    end if
  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