rewind() (Animated GIF, Flash)

Usage

-- Lingo syntax
animGifSpriteRef.rewind()

// JavaScript syntax
animGifSpriteRef.rewind();

Description

Command; returns a Flash or animated GIF movie sprite to frame 1 when the sprite is stopped or when it is playing.

Parameters

None.

Example

The following frame script checks whether the Flash movie sprite in the sprite the behavior was placed in is playing and, if so, continues to loop in the current frame. When the movie is finished, the sprite rewinds the movie (so the first frame of the movie appears on the Stage) and lets the playhead continue to the next frame.

-- Lingo syntax
property spriteNum

on exitFrame 
   if sprite(spriteNum).playing then
      _movie.go(_movie.frame)
   else
      sprite(spriteNum).rewind()
      _movie.updatestage()
   end if
end

// JavaScript syntax
function exitFrame() { 
   var plg = sprite(this.spriteNum).playing;
   if (plg = 1) {
      _movie.go(_movie.frame);
   } else {
      sprite(this.spriteNum).rewind();
      _movie.updatestage();
   }
}

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/director/mx2004/release_en/07_me370.htm