Implementing animation

This sample code implements animation.

Copy
<!-- #include file ="sagecrm.js"-->
<%

var progress=70;
var anim=CRM.GetBlock('graphic');
with(anim) 
{
    ImageWidth=130;
    ImageHeight=20;
    Pen('Color','Black');
    MoveTo(0,0);
    LineTo(99,0);
    LineTo(99,19);
    LineTo(0,19);
    LineTo(0,0);
    Rectangle(0,0,100,20);
    Pen('Color','Blue');
    
    for (y=1;y<=progress;y++)
    {
        MoveTo(y,1);
        LineTo(y,19);
        TextOutCenter(101,0,129,19,y+'%',false,false);
        Animation('add','10')
    }
}

var container=CRM.GetBlock('container');
with(container)
{
    AddBlock(anim);
    DisplayButton(Button_Default)=false;
}

CRM.AddContent(container.Execute());
Response.Write(CRM.GetPage());

%>