0

我正在将旧的 Captivate 4、Actionscript 2 GoToSlide 小部件转换为 Captivate 5 和 Actionscript 3。

旧窗口小部件的 FLA 文件在 Flash 中打开时具有 Actionscript 2 代码,其中包括位于文件时间线顶层的以下摘录。下面的倒数第三行显然控制了翻转时文本的颜色:

  mc.onRollOver = function() {
    this._parent._visible = true;
    ...
    txt_fmt.color = 0xffff00;
    this.item_txt.setTextFormat(txt_fmt);
}

我在等效的 Actionscript 3 GoToSlide Flash 文件中找不到任何可比较的点来定义翻转的文本颜色。谁能帮我找到它,并为 txt_fmt.color = 0xffff00; 提供等效的 AS3 语法。?

谢谢..

4

1 回答 1

0

所以几周后...

在 GoToSlide 小部件的 FLA 文件中的 Actionscript 中 - 这似乎是组合框和列表框组件的变体 - 对于填充组合框下拉列表的循环,我放了这个:

for (var i=0; i<cbItemArray.length; i++)
{
    var obj:Object = new Object();
    obj.label = cbItemArray[i];
    CB.addItem(obj);
    var myFormatButton:TextFormat = new TextFormat();
    myFormatButton.size = 9;
    myFormatButton.color = 0xffffff;
    myFormatButton.font = "Helvetica";
    var myFormatDropdown:TextFormat = new TextFormat();
    myFormatDropdown.size = 15;
    myFormatDropdown.color = 0xffffff;
    myFormatDropdown.font = "Helvetica";
    CB.textField.setStyle("embedFonts", true);
    CB.textField.setStyle("textFormat", myFormatButton);
    CB.dropdown.setRendererStyle("embedFonts", true);
    CB.dropdown.setRendererStyle("textFormat", myFormatDropdown);
    CB.dropdownWidth = 337;
    CB.rowCount="20";
    CB.dropdown.rowHeight=30;
    CB.prompt = "OVERVIEW"; //default value that won't show in the dropdown

                    }

这实际上并没有回答我原来的问题——因为它不会改变文本颜色..(对我来说,这暂时还在太难的篮子里:我认为你必须定义一个自定义组合框或列表框组件来做到这一点)..但它确实控制其他组合框参数 - 下拉宽度,rowHeight,字体等。

于 2011-10-14T04:18:14.750 回答