(this is from my old blog)

A few months ago I needed to implement a small loading animation (similar to the typical “AJAX”/Firefox circle animations seen in most RIA apps). As the IPTV platform I’m working on doesn’t support animated gifs, I had to develop my own “format” in JavaScript. This turned out to be a pretty slick component so I included it into our component library.

var i = 0;
   var layer = document.layers[0];
   layer.name = "frame"+i;
   for(var j=0; j<settings.n; ++j)
      var angle = step*j;
      var radius = rs[j]; 

      var x = settings.x+Math.cos(angle)*
      var y = settings.y+Math.sin(angle)*

      var circle = layer
         .pathItems.ellipse(x, y, radius*2, radius*2);
      circle.stroked = false;
      circle.fillColor = settings.colorfn(i,j);

   if(settings.colorfn == colorTail)
      var e = fgtable.pop();

   if(i<=settings.n) document.layers.add();
} while(i<=settings.n)

To accompany my “FrameAnimation” component I wanted to create a few reference animations and started drawing a few circle animations in Adobe Illustrator. But as manual labour isn’t my thing :) , I of course has to create a script for generating the induvidual frames and then another for saving each frame as a PNG.

Downloads the source files:

Tagged with:

2 Responses to Scripting an animation in Adobe Illustrator CS2

  1. Peter M says:

    I am trying to get Google Page Rank values in excel. I have downloaded SeoTools-v1.4 but the functions doesn’t seem to work despite enabling the plugin (Office 2007) and calling up the function. I even used your “IsDomainRegisteredExample.xlsx” but a refresh on that page bring up “#NAME?” error in boxes where you have values.

    Please help.

  2. nielsbosma says:

    Are you following the guide for using the plugin properly? Even if you open “IsDomainRegisteredExample.xlsx” you still need to add the plugin to the session.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>