code: private JMFType findChildByIndex(JMFType start, int index) {
      if (index < 0)
        return null;
      if (start instanceof JSVariant) {
        JSVariant var = (JSVariant)start;
        int cases = var.getCaseCount();
        if (index >= cases)
          return null;
        else
          return getEffectiveType(var.getCase(index));
      } else {
        JSTuple tup = (JSTuple)start;
        int fields = tup.getFieldCount();
        if (index >= fields)
          return null;
        else
          return getEffectiveType(tup.getField(index));
      }
    }
docs: variant