<HTML> 
<HEAD>
<TITLE>DirectAnimation SDK, VBScript sample</TITLE>
<SCRIPT LANGUAGE="JScript">
<!--
if (window.top.frames.length!=0 && window.top.frames[0].ShowNoButtons!=null)
    window.top.frames[0].ShowNoButtons();
//-->
</SCRIPT>
</HEAD>	 

<BODY BGCOLOR=WHITE TOPMARGIN=15 LEFTMARGIN=20>
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2> 
<CENTER>
<H1>Using Modifiable Behaviors and Scrollbars</H1>
</CENTER>


<OBJECT ID="DAControl"
  STYLE="position:absolute; left:20; top:100; width:250; height:200;"
  CLASSID="CLSID:B6FFC24C-7E13-11D0-9B47-00C04FC2F51D">
</OBJECT>

<OBJECT ID="PosScroll"   
 STYLE="position:absolute;left:20;top:300;width:250;height:20"
 CLASSID="CLSID:DFD181E0-5E2F-11CE-A449-00AA004A803D">
    <PARAM NAME="Max" VALUE="200">
	<PARAM NAME="Position" VALUE="100">
    <PARAM NAME="LargeChange" VALUE="10">
    <PARAM NAME="Orientation" VALUE="1">
</OBJECT>

<DIV STYLE="position:absolute; left:280; top:100;width:50%;">
This sample demonstrates the use 
of a stream of events from a VB slider to
repeatedly modify a behavior. In this case the position
of the scrollbar is mapped to the X position of the oval.
</DIV>

<SCRIPT LANGUAGE="VBScript">
<!--
  ' The DirectAnimation library.
  Set m = DAControl.PixelLibrary

  ' Define the x coordinate which will be linked to position of the scrollbar.
  Set imgXPos = m.ModifiableBehavior(m.DANumber(0))

  Sub window_onLoad 
   
    ' Create a red oval.
    Set redOvalImg = m.Oval(50,50).Fill(m.DefaultLineStyle, _ 
	  m.SolidColorImage(m.Red))
    Set redOvalImg = redOvalImg.Transform(m.Translate2Anim(imgXPos, _
	  m.DANumber(0)))


    ' Set image
    DAControl.Image = m.Overlay(redOvalImg,m.SolidColorImage(m.Black))

    ' Set the background in case of a non-windowless browser (like IE3).
    DAControl.BackgroundImage = m.SolidColorImage(m.Blue)

    ' Start the animation.
    DAControl.Start()
  End Sub

  Sub PosScroll_change()
    '  Change imgXPos to the value property of the scrollbar.
    imgXPos.SwitchTo(m.DANumber(PosScroll.Value-100))
  End Sub
-->
</SCRIPT>
</FONT>
</BODY>
</HTML>
