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
Director Publications
AnySaver
Roil-Alphamania
Hold for X seconds if no input is given
TranZtions
Fix Bad Scripts
Semi-Random Bezier Animatior
Slider bar-Alphamania
encrypt/decrypt Image
Regular expressions
 

 

 

Behavior Cyclic appearing and disappearing of sprite.

Added on 7/14/2003

 

Compatibilities:
D7 D8 D8_5 D9

This item has not yet been rated

Author: zkos (website)

Cyclic appearing and disappearing of sprite with randomness.

property mySprite, triger, speed

on beginSprite me
  mySprite = sprite(me.spriteNum)
  mySprite.blend = random(100)
  triger = 0
  speed = 2 --speed of appearing
end

on enterFrame me
  if triger = 0 then    
    mySprite.blend = mySprite.blend + speed
    
    if mySprite.blend = 100 then      
      triger = 1
    end if    
  end if
  
  if triger = 1 then
    
    mySprite.blend = mySprite.blend - speed
    
    if mySprite.blend = 0 then
      
       triger = 0
    end  if
  end if
  
  
end

 


Contact

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

Send e-mail