<HTML>
<HEAD>
<TITLE>DirectX Media SDK DirectAnimation Tutorial</TITLE>
<LINK REL=STYLESHEET HREF="../../../../../webcd/da/tutorial.css">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso8859-1">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="ROBOTS" CONTENT="noindex">
</HEAD>
<BODY BGCOLOR="WHITE" LINK=#0033CC TOPMARGIN=0 LEFTMARGIN=20>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->

<DIV CLASS="flush">
<TABLE WIDTH=100% BORDER=0 BGCOLOR=#000000>
<TR ALIGN=RIGHT><TD VALIGN=TOP><FONT CLASS=desc1 SIZE=2>
<A HREF="Section1.html" TARGET="_top">
<IMG SRC="../../../../../media/image/u_prev.gif"
 WIDTH=71 HEIGHT=16 BORDER=0 ALT="Previous Topic">
</A><A HREF="../../../../../webcd/da/tutorial_main.htm" TARGET="_top">
<IMG SRC="../../../../../media/image/d_home.gif" WIDTH=48 HEIGHT=16 BORDER=0 ALT="Tutorial Home Page"></A>
<A HREF="Section3.html" TARGET="_top">
<IMG SRC="../../../../../media/image/u_next.gif" WIDTH=48 HEIGHT=16 BORDER=0 ALT="Next Topic">
</A></FONT></TD><TD WIDTH=30></TD></TR></TABLE></DIV>
<FONT CLASS=title><CENTER>Obtaining the Color from the Scrollbars</CENTER></FONT>
<BR>
<FONT CLASS=desc1> 
Here, in the Using_VBScript.html file, three subroutines are created which<BR>
retrieve the scrollbar values and set the VBScript class R,G,B data members.<BR>
They then call updateColor in the VBScriptModel class, which then updates<BR> 
the color of the sphere applet of a change in color.
</FONT><BR>

<TABLE WIDTH=100%><TR><TD WIDTH=5%><TD><FONT CLASS=code>

&ltSCRIPT LANGUAGE="VBScript"&gt<BR>
&lt!--<BR>
Sub RedScroll_Change()<BR>
<DIV STYLE="margin-left: 0.1875in">RedDec.Text=RedScroll.Value<BR>
RedHex.Text=Hex(RedScroll.Value)<BR>
document.DxmControl.R=RedScroll.Value/256<BR>
UpdateVals<BR>
</DIV>End Sub<BR>
<BR>
Sub GreenScroll_Change()<BR>
<DIV STYLE="margin-left: 0.1875in">GreenDec.Text=GreenScroll.Value<BR>
GreenHex.Text=Hex(GreenScroll.Value)<BR>
document.DxmControl.G=GreenScroll.Value/256<BR>
UpdateVals<BR>
</DIV>End Sub<BR>
<BR>
Sub BlueScroll_Change()<BR>
<DIV STYLE="margin-left: 0.1875in">BlueDec.Text=BlueScroll.Value<BR>
BlueHex.Text=Hex(BlueScroll.Value)<BR>
document.DxmControl.B=BlueScroll.Value/256<BR>
UpdateVals<BR>
</DIV>End Sub<BR>
<BR>
Sub UpdateVals<BR>
<DIV STYLE="margin-left: 0.1875in">ColorTextBox.Backcolor = RGB(RedScroll.Value, GreenScroll.Value, BlueScroll.Value)<BR>
document.DxmControl.updateColor()<BR>
</DIV>End Sub<BR>
--&gt<BR>
&lt/SCRIPT&gt<BR>
<BR>
</FONT><FONT CLASS=link><A ID=cpslug HREF="../../../../../help/da/dalegal.htm" TARGET="_top">&#169; 1997 Microsoft Corporation. All rights reserved. Terms of Use.</A></FONT>
</TABLE>
<BR>
<BR>
<DIV CLASS="flush">
<TABLE WIDTH=100% BORDER=0 BGCOLOR=#000000>
<TR ALIGN=RIGHT><TD VALIGN=TOP><FONT CLASS=desc1 SIZE=2>
<A HREF="Section1.html" TARGET="_top">
<IMG SRC="../../../../../media/image/u_prev.gif"
 WIDTH=71 HEIGHT=16 BORDER=0 ALT="Previous Topic">
</A><A HREF="../../../../../webcd/da/tutorial_main.htm" TARGET="_top">
<IMG SRC="../../../../../media/image/d_home.gif" WIDTH=48 HEIGHT=16 BORDER=0 ALT="Tutorial Home Page"></A>
<A HREF="Section3.html" TARGET="_top">
<IMG SRC="../../../../../media/image/u_next.gif" WIDTH=48 HEIGHT=16 BORDER=0 ALT="Next Topic">
</A></FONT></TD><TR><TD WIDTH=30></TD></TR></TABLE></DIV>

</BODY>
</HTML>
