title: Nonfunctioning "for loop" for addressing each variable of class
body: <p>I'm learning AS3 but have some antiquated background in programming (TP and Atari Basic).  On this forum I learned to use a loop such as the one below to address each variable in an object class, in order to make a clone of the object (deep or shallow) or in my case to build the text for a tooltip.  However mine doesn't work.  Here's the loop, following is an explanation, any help you can give I'd appreciate greatly!</p>
  
  <pre><code>var tooltipText:String;
  var i:String;
  for (i in bsm) {
      if (!(bsm[i] is String)) {
          if (bsm[i] != 0) {
              tooltipText = i + ": " + bsm[i];
              tooltip.extendTooltip(tooltipText, 0xFFFFFF);
          }
      }
  }
  </code></pre>
  
  <p>Please forgive the horrible variable names.  'i' is a String.  'bsm' is a non-null instance of class StatMod, which begins with</p>
  
  <pre><code>public class StatMod extends Object {
      public static const ENCHANTMENTMODIFIER:String = "enchantmentModifier";
      public var enchantmentType:String = "None";
      public var enchantmentDescriptor:String = "None";
      public var minDamage:Number = 0;
      public var maxDamage:Number = 0;
      public var attackSpeed:Number = 0.2;
  </code></pre>
  
  <p>The intended behavior is to go through each of the variables of StatMod (I'm not showing them all and I will add more later), and if the variable is a non-zero number, make a string ("attackSpeed: 0.2" for instance) and then add that string to the tooltip.  The tooltip.extendTooltip function is working properly.</p>
  
  <p>The observed behavior is basically the computer believing that there are no variables in bsm.</p>
  
  <p>What can I say or do to convince the computer that there actually <em>are</em> variabels in bsm?</p>