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
Hilite Line
Returns Rect of visible PDF doc within an Impressario sprite
ControlXtra
Exit Windows
Direct-L
FreeRotate
Eat That Dot
Play MPEG with MCI commands
Drop Shaddow Button-Alphamania
Filemanager
 

 

 

Behavior Animate Image Sequence

Added on 4/20/2000

 

Compatibilities:
behavior D6_5 D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: StevenSacks

The sprite will swap images at a steady rate, regardless of any updateStage commands (unlike film loops). Place this script on the sprite to animate, then set the rate you want it to animate at, and the number of images to animate. To use the script, sendSprite(whichSprite, #toggleBlink).

property blink, anim, animStart, animEnd, rate, inum, spriteNum, mySprite

global trackAnim

on beginsprite me
  mySprite = sprite(spriteNum)
  blink = TRUE
  animStart = mySprite.membernum
  animEnd = animStart + (inum-1)
  anim = animStart
  trackAnim = anim
end beginsprite

on enterframe me
  if blink = TRUE then
    anim = anim + rate
    trackAnim = anim
    if anim > (animEnd+1) - rate then
      anim = float(animStart)
    end if  
    mc = the number of chars of (string(anim)) - (the floatPrecision + 1)
    theMem = value(char 1 to mc of string(anim))
    mySprite.membernum = theMem
  else
    nothing
  end if
end enterframe

on getPropertyDescriptionList me
  pList = [:]
  pList.addProp(#rate, [#format:#float,#default:.2,#comment:"Rate:"])
  pList.addProp(#inum, [#format:#integer,#default:2,#comment:"Image Num:"])
  return pList
end getPropertyDescriptionList

on toggleBlink me
  blink = NOT blink
end

 


Contact

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

Send e-mail