Show animation in MSD axapta form by code

Drag Animate controls to desgin of the form to show the progress and set auto declaration property to yes. On run method you can write following code
 int cnt;  
  #AviFiles  
  ;  
  super();  
  for (cnt = 1 ; cnt <= 5000; cnt++)  
  {  
  Animate1.animateFile(#AviPrint);  
  Animate1.play();  
 }  
 Animate.visible(false);