Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Scale the screen
Format Text
Text Box Xtra
Pauseable Timer with Progress Bar
Dual Button With Rollover Effect
DirectX / Direct Show
Send OSA Script
PopUp Field
Custom Radio/Check Box
Import image (at runtime)
MediaMacros Xtras Mall
 

 

 

Behavior Progressive Blend on Rollover

Added on 2/6/2001

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: RossClutterbuck

Use the script on a bitmap, then define the steps and whether the action is on mouseenter and/or mouseleave.

-- USER PROPERTIES --
property myStartBlend, myEndBlend, myBlendStep, boolPosBlend
property userStepsNumber, userRollInFade, userRollOutFade

-- INTERNAL SCRIPTING PROPERTIES --
property mySprite

on beginSprite me
  mySprite = sprite(me.spriteNum)
  
  myBlendStep = (myEndBlend - myStartBlend) / userStepsNumber
  
  -- create positive number if myBlendStep is negative...
  if myBlendStep < 0 then
    myBlendStep = myBlendStep - (myBlendStep * 2)
  end if
  
  mySprite.blend = myStartBlend
  
  if myStartBlend < myEndBlend then
    boolPosBlend = TRUE
  else
    boolPosBlend = FALSE
  end if
end

on prepareFrame
  if mySprite.rollover = TRUE then
    if userRollInFade = TRUE then
      if mySprite.blend <> myEndBlend then
        if boolPosBlend = TRUE then
          FadeUp myEndBlend
        else
          FadeDown myEndBlend
        end if
      end if
    else
      mySprite.blend = myEndBlend      
    end if
  else
    if mySprite.blend <> myStartBlend then
      if userRollOutFade = TRUE then
        if boolPosBlend = TRUE then
          FadeDown myStartBlend
        else
          FadeUp myStartBlend
        end if
      else
        mySprite.blend = myStartBlend
      end if
    end if
  end if
end

-- CUSTOM HANDLERS --

on FadeUp myTargetCheck
  myBlendValue = mySprite.blend
  
  myBlendValue = myBlendValue + myBlendStep
  
  if myBlendValue >= myTargetCheck then
    myBlendValue = myTargetCheck
  end if
  
  mySprite.blend = myBlendValue
end

on FadeDown myTargetCheck
  myBlendValue = mySprite.blend
  
  myBlendValue = myBlendValue - myBlendStep
  
  if myBlendValue <= myTargetCheck then
    myBlendValue = myTargetCheck
  end if
  
  mySprite.blend = myBlendValue
end

-- AUTHORTIME PROPERTY HANDLERS --

on getPropertyDescriptionList me
  set myProperties = [:]
  
  addProp myProperties, #myStartBlend,¬
    [#comment: "Initial blend value of sprite:",¬
     #format:  #integer,¬
     #range:   [min: 0, max: 100],¬
     #default: 50¬
    ]
  
  addProp myProperties, #myEndBlend,¬
    [#comment: "Final blend of sprite:",¬
     #format:  #integer,¬
     #range:   [min: 0, max: 100],¬
     #default: 100¬
    ]
  
  addProp myProperties, #userStepsNumber,¬
    [#comment: "Number of stages to blend over:",¬
     #format:  #integer,¬
     #range:   [min: 4, max: 25],¬
     #default: 10¬
    ]
  
  addProp myProperties, #userRollInFade,¬
    [#comment: "Use blending effect on mouse over?",¬
     #format:  #boolean,¬
     #default: TRUE¬
    ]
  
  addProp myProperties, #userRollOutFade,¬
    [#comment: "Use blending effect on mouse out?",¬
     #format:  #boolean,¬
     #default: TRUE¬
    ]
  
  return myProperties
end

on isOKToAttach me, spriteType, spriteNum
  case spriteType of
    #graphic:
      return sprite(spriteNum).member.type <> #digitalvideo
    #script:
      return FALSE
  end case
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