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
Line Skip-Alphamania
Simple file open/save dialog behavior
Vector Shapes - Create Donut
Password Protection in a Projector
Make Bitmaps from Flash
DirSaver
Animation on MouseUp
Print a file with associated program
HSB Shifter-Alphamania
simFTPServer Xtra 1.0 Beta
 

 

 

Behavior Sprite on/off

Added on 8/23/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: SunilBalan

Drop this behaviour on the frame and specify the sprite which you want to switch on/off.

property pSprite, pRange

on getPropertyDescriptionList me
  description = [:]
  addprop description,  #pSprite, [#comment:"Switch on/off which sprite", #format:#integer, #default:1]
  addProp description, #pRange, [#comment: "Speed", #format:#Integer, #range:[#min:1,#Max:40],#default:20]
  return description
end getPropertyDescriptionList



on pSwitch mySprite
  global gTime
  if voidP(gTime) then
    set gTime to the timer
  end if
  if the timer > gTime + pRange then
    set the visible of sprite mySprite to not the visible of sprite mySprite
    set gTime to the timer
  end if
  if the timer < gTime - pRange then
    set gTime to the timer
  end if
end


on exitframe
  go the frame
  pSwitch pSprite
end

 


Contact

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

Send e-mail