<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I fully understood what you're doing. I didn't need 
to see </FONT></DIV>
<DIV><FONT face=Arial size=2>the rest. You're trying to dynamically set an 
image's source.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm sure you have them named:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>nt_o1, nt_o2, nt_o3, etc...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>What I was saying is that you're referencing them 
incorrectly </FONT></DIV>
<DIV><FONT face=Arial size=2>which is why you think you need a dynamic 
variable.&nbsp; If you were </FONT></DIV>
<DIV><FONT face=Arial size=2>to reference the element through the .image 
collection, you'd </FONT></DIV>
<DIV><FONT face=Arial size=2>be able to access them by name or index. 
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Since you're </FONT><FONT face=Arial size=2>looking 
to reference them by name (the correct </FONT></DIV>
<DIV><FONT face=Arial size=2>choice in my book), </FONT><FONT face=Arial 
size=2>you are forming a value, not a variable.&nbsp; </FONT></DIV>
<DIV><FONT face=Arial size=2>Your value is the string "nt_o" </FONT><FONT 
face=Arial size=2>+ the dynamic value of i</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>So my real suggestion out of that was to reference 
the image </FONT></DIV>
<DIV><FONT face=Arial size=2>through the collection rather than trying to 
reference it by </FONT></DIV>
<DIV><FONT face=Arial size=2>ID.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Chris Tifer</FONT></DIV>
<DIV><FONT face=Arial size=2><A 
href="http://emailajoke.com">http://emailajoke.com</A></FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=grillo@lazzuri.com.br href="mailto:grillo@lazzuri.com.br">Marcelo 
  Simon</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu 
  href="mailto:javascript@LaTech.edu">[JavaScript List]</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 24, 2003 1:44 
PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Javascript] dynamic 
  variables names</DIV>
  <DIV><BR></DIV>
  <DIV><FONT size=2>Thanks for the answers, but they didn't solve my 
  problem.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>I didn't&nbsp;post the entire function, and that's why I 
  think you say that I don't have a dynamic variable name. ( or maybe I'm wrong 
  ), here's the function</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>function note(number){<BR>&nbsp;for ( var i=1; i &lt; 6; 
  i++){<BR>&nbsp;&nbsp;if ( i &lt;= number ){</FONT></DIV>
  <DIV><FONT size=2>&nbsp;&nbsp;alert(['nt_0'+i].src); // it's tracing 
  undefined<BR>&nbsp;&nbsp;&nbsp;['nt_o'+i].src = 
  '../_img/1_note_0'+i+'_on.gif';<BR>&nbsp;&nbsp;} else 
  {<BR>&nbsp;&nbsp;&nbsp;['nt_o'+i].src = 
  '../_img/1_note_0'+i+'_off.gif';<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>what I'm trying to accomplish, is to change some images from 
  1 to i based on the number I pass to the function (ie. if I pass 3, I want 
  images 1,2 and 3 to be on and 4 and 5 to be off ), so if someone has a 
  different approach to this please share.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Thanks again</FONT></DIV>
  <DIV><FONT size=2>Marcelo Simon</FONT></DIV>
  <BLOCKQUOTE 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV style="FONT: 10pt arial">&nbsp;</DIV>
    <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=christ@saeweb.com href="mailto:christ@saeweb.com">Chris Tifer</A> 
    </DIV>
    <DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu 
    href="mailto:javascript@LaTech.edu">[JavaScript List]</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 24, 2003 1:10 
    PM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Javascript] dynamic 
    variables names</DIV>
    <DIV><BR></DIV>
    <DIV><FONT face=Arial size=2>Do you have a dynamic variable name? I would 
    never use a </FONT></DIV>
    <DIV><FONT face=Arial size=2>dynamic variable to be honest with you - or at 
    least haven't ever </FONT></DIV>
    <DIV><FONT face=Arial size=2>found the need for one yet, but from the looks 
    of it below, you </FONT></DIV>
    <DIV><FONT face=Arial size=2>don't have a dynamic variable, but rather 
    you're trying to build </FONT></DIV>
    <DIV><FONT face=Arial size=2>a reference to an image 
    dynamically.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>To do that, use the document.images collection 
    and </FONT></DIV>
    <DIV><FONT face=Arial size=2>build your string when targeting a specific 
    element in that </FONT></DIV>
    <DIV><FONT face=Arial size=2>collection:</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>document.images["nt_o" + i].src = 
    "path/to/image.gif"</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>That's not a dynamic variable name - just so 
    you're aware.</FONT></DIV>
    <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2>Chris Tifer</FONT></DIV>
    <DIV><FONT face=Arial size=2><A 
    href="http://emailajoke.com">http://emailajoke.com</A></FONT></DIV>
    <DIV>&nbsp;</DIV>
    <BLOCKQUOTE 
    style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
      <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
      <DIV 
      style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
      <A title=grillo@lazzuri.com.br href="mailto:grillo@lazzuri.com.br">Marcelo 
      Simon</A> </DIV>
      <DIV style="FONT: 10pt arial"><B>To:</B> <A title=javascript@LaTech.edu 
      href="mailto:javascript@LaTech.edu">* Yahoo / Javascript</A> </DIV>
      <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 24, 2003 11:50 
      AM</DIV>
      <DIV style="FONT: 10pt arial"><B>Subject:</B> [Javascript] dynamic 
      variables names</DIV>
      <DIV><BR></DIV>
      <DIV><FONT size=2>Hi list, </FONT></DIV>
      <DIV><FONT size=2></FONT>&nbsp;</DIV>
      <DIV><FONT size=2>It's me again, and I need some help again 
      please.</FONT></DIV>
      <DIV><FONT size=2></FONT>&nbsp;</DIV>
      <DIV><FONT size=2>how can I use dynamic variables name in JS 
?</FONT></DIV>
      <DIV><FONT size=2></FONT>&nbsp;</DIV>
      <DIV><FONT size=2>I mean, <FONT size=2>how do I evaluate the 2 parts so 
      they work ?</FONT></FONT></DIV>
      <DIV><FONT size=2></FONT><FONT size=2></FONT>&nbsp;</DIV>
      <DIV><FONT size=2>if ( i &lt;= number 
      ){<BR>&nbsp;&nbsp;&nbsp;['nt_o'+i].src = 
      '../_img/1_nota_0'+i+'_on.gif';<BR>}</FONT></DIV>
      <DIV><FONT size=2></FONT>&nbsp;</DIV>
      <DIV><FONT size=2>thanks in advance</FONT></DIV>
      <P>
      <HR>

      <P></P>_______________________________________________<BR>Javascript 
      mailing list<BR><A 
      href="mailto:Javascript@LaTech.edu">Javascript@LaTech.edu</A><BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE>
    <P>
    <HR>

    <P></P>_______________________________________________<BR>Javascript mailing 
    list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>Javascript mailing 
  list<BR>Javascript@LaTech.edu<BR>https://lists.LaTech.edu/mailman/listinfo/javascript<BR></BLOCKQUOTE></BODY></HTML>