sIFR r436 - 警告:indexOf不是函数

时间:2009-04-17 18:35:58

标签: flash sifr

注意:从joyent论坛(http://discuss.joyent.com/viewtopic.php?id=25229)交叉发布

我可能会发疯,但我会在我的flash调试日志中看到这些消息:

警告:indexOf不是函数

我没有在sIFR演示页面上看到这些消息,所以它让我觉得这是我在我的目的所做的事情,不管我是否能够最终将它追溯到SifrStyleSheet.as中的这个函数:< / p>

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;
  }

我找不到这个函数被调用的地方,它看起来像style.fontSize只使用font-size css属性的数字部分,所以寻找“%”将是徒劳的。我疯了吗?是否有一个CSS属性会导致调用此函数?

谢谢,

- 克里斯

1 个答案:

答案 0 :(得分:0)

好像你的一个样式使用“font-size”而且它失败了。也许你应该首先验证你的CSS文件,以确保你没有忘记尾随“;”或者使用fontSize而不是font-size,或者你的字体大小值不好?你也可以发布CSS吗?