home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 June / CHIPINTE062000.ISO / exe / firework.exe / data1.cab / App_Files / Settings / Commands / Animation / Rotate.jsf < prev   
Encoding:
Text File  |  1999-11-23  |  831 b   |  26 lines

  1. // Copyright (c) 1999 Macromedia. All rights reserved.
  2.  
  3. // Tell the user what is going to happen
  4. var message = confirm("This command creates a multi-frame animation by rotating the objects in the document.");
  5.  
  6. if (message == true)
  7. {
  8.     // Add frames for the animation
  9.     var kNumFrames = 12;
  10.  
  11.     fw.getDocumentDOM().addFrames(kNumFrames, "after current");
  12.     fw.getDocumentDOM().selectAll();
  13.     fw.getDocumentDOM().duplicateSelectionToFrames("all");
  14.  
  15.     var angle = 30;
  16.     for (frameNum = 1; frameNum <= kNumFrames; frameNum++) {
  17.         fw.getDocumentDOM().currentFrameNum = frameNum;
  18.         fw.getDocumentDOM().selectAll();
  19.         fw.getDocumentDOM().rotateSelection(angle, "autoTrimImages transformAttributes");
  20.         angle += 30;
  21.     }
  22.  
  23.     // Set the export options
  24.     fw.getDocumentDOM().setExportOptions({ exportFormat:"GIF animation" });
  25. }
  26.