home *** CD-ROM | disk | FTP | other *** search
/ Microsoft DirectX SDK 7.0 / Dx7.bin / DXF / doc / directx6.1 / directx.chm / dxmedia / foundation / d3drm / anim.js next >
Encoding:
Text File  |  1999-03-03  |  2.2 KB  |  59 lines

  1.  
  2. function HdgrphControl(){
  3.     HeadGraphAnim.innerHTML = '   <OBJECT ID="DAControl" STYLE="position:absolute; left:0; top:11;width:702;height:90" CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D"></OBJECT>';
  4.     HdgrphAnimate();
  5.     window.setInterval("DestroyAnim()", 4300);
  6. }
  7.  
  8. function DestroyAnim(){
  9.     HeadGraphAnim.innerHTML = '';
  10. }
  11. function HdgrphAnimate(){
  12.   // The DirectAnimation library
  13.   m = DAControl.PixelLibrary;
  14.   
  15.   glowBase = m.importImage(sRelPath + "art/glow.gif");
  16.   xImage = m.importImage(sRelPath + "art/newtransx.gif");
  17.   xImage = xImage.Transform(m.Translate2(-303,0));
  18.  
  19.     glowPath1 = m.Polyline( new Array( 295,26, 305,26, 305,50, 310,57, 526,57, 
  20.     543,40, 543,17, 682,17, 682,23 ) );
  21.  
  22.   glowPath2 = m.PolyLine( new Array( 44,41, 44,25, 52,16, 84,16, 106,16 ) );
  23.  
  24.   glowPath3 = m.PolyLine( new Array( 57,55, 69,55, 78,65, 92,65, 99,58,
  25.     99,82, 95,85, 95,93, 132,93, 132,78,
  26.     303,78, 315,66, 556,66, 556,17, 682,17,
  27.     675,23 ) );
  28.  
  29.   glowPath4 = m.PolyLine( new Array( 29,55, 19,55, 19,31, 38,30, 38,21,
  30.     46,16, 106,16 ) );
  31.  
  32.   glowPath5 = m.PolyLine( new Array( 45,62, 45,81, 37,81, 41,85, 46,85,   
  33.   51,91, 68,91, 66,81, 90,81, 90,65, 94,65, 105,47 ) );
  34.  
  35.   glow1 = glowBase.Transform( moveGlow( glowPath1, 5 ) );
  36.   glow2 = glowBase.Transform( moveGlow( glowPath2, 2 ) );
  37.   glow3 = glowBase.Transform( moveGlow( glowPath3, 8 ) );
  38.   glow4 = glowBase.Transform( moveGlow( glowPath4, 2.5 ) );
  39.   glow5 = glowBase.Transform( moveGlow( glowPath5, 2 ) );
  40.   
  41.   finalImg = m.Overlay(xImage, m.Overlay( glow5, m.Overlay( glow4, 
  42.     m.Overlay( glow3, m.Overlay( glow2, glow1)))));
  43.  
  44.   // set the model, an image, as the model to be displayed
  45.   DAControl.Image = m.Until(finalImg, m.Timer(4), m.EmptyImage);//m.Overlay(finalImg, background);
  46.   // set the background in case of a non-windowless browser (like IE3)
  47.   DAControl.BackgroundImage = m.SolidColorImage(m.Blue);         
  48.   DAControl.Start()
  49.   }
  50.  
  51.   function moveGlow(path, speed)  {
  52.     imDimX = 702;
  53.     imDimY = 120;
  54.  
  55.     coordsXf = m.Translate2(-imDimX/2, -imDimY/2);
  56.     path = path.Transform(coordsXf);
  57.     return xf = m.FollowPath(path, speed).RepeatForever();
  58.   }
  59.