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
Removing the stage border
Can't get picture from field - Valentina
DirectOS Xtra
Video Mask
Property Inspector
Curve Sprite - Move a sprite along a curved path.
Sound does not play in Shockwave
Image Mover
Clipboard Xtra
RoboHelp 5 Review
 

 

 

Behavior Fade till done

Added on 10/20/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

Rating:

Author: SunilBalan

Drop this behaviour on the frame script to hold the fade till finishes.

-- This behaviour on the frame script holds the fade till
-- finishes and goes to the next frame.
-- sunilbalan@usa.net

property pSprite, pFade, pSpeed

on getPropertyDescriptionList
  description = [:]
  if the currentspritenum > 0 then exit
  addprop description, #pSprite, [#comment:"Which sprite to fade:", #default:1, #format:#integer]
  addprop description, #pFade, [#comment:"Select your option:", #default:"Fade in", #range:[#"Fade in", #"Fade out"], #format:#string]
  addprop description, #pSpeed, [#comment:"Speed of fade", #default:1, #format:#integer, #range:[#"1", #"2", #"4", #"5", #"10", #"20"]]
  return description
end getPropertyDescriptionList


on beginsprite
  if pFade = "Fade out" then
    pFade = 0
    pSpeed = - pSpeed
    the blend of sprite pSprite = 100
  end if
  
  if pFade = "Fade in" then
    pFade = 100
    the blend of sprite pSprite = 0
  end if
end


on exitframe
  sprite(pSprite).blend = sprite(pSprite).blend + pSpeed
  if sprite(pSprite).blend = pFade then
    go the frame +1
  else
    go the frame
  end if
end

 


Contact

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

Send e-mail