R – sIFR r436 – Warning: indexOf is not a function

flashsifr

note: cross-posted from joyent forums (http://discuss.joyent.com/viewtopic.php?id=25229)

I might be crazy, but I keep seeing these messages in my flash debug log:

Warning: indexOf is not a function

I don't see these messages on the sIFR demo page, so it makes me think it is something I am doing on my end, regardless I was able to finally trace it down to this function inside of SifrStyleSheet.as:

public function transform(style) {
    var format = super.transform(style);
    if(style.leading) format = applyLeading(format, style.leading);
    if(style.letterSpacing) format.letterSpacing = style.letterSpacing;
    if(style.fontSize) {
      // Support font sizes relative to the size of .sIFR-root.
      if (this.fontSize && style.fontSize.indexOf('%') > 0) {
        format.size = this.fontSize * parseInt(style.fontSize, 10) / 100;
      } else {
        format.size = parseInt(style.fontSize, 10);
      }     
    }
    format.kerning = _root.kerning == 'true' || !(_root.kerning == 'false') || sIFR.defaultKerning;
    return format;
  }

I could not find a place where this function is ever called and it looks like style.fontSize only uses the numeric part of the font-size css property so looking for "%" would be futile. Am I insane? Is there a CSS property that would cause this function to be called?

Thanks,

–Chris

Best Answer

Seems like one of your styles uses "font-size" and it's failing on that. Perhaps you should validate your CSS file first to make sure you didn't forget a trailing ";" or use fontSize instead of font-size, or perhaps you have a bad value for the font size? Can you post the CSS as well?