更改 Actionscript 3 GoToSlide 小部件中的文本样式

发布于 2024-12-04 10:11:07 字数 502 浏览 3 评论 0原文

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

在 Flash 中打开时,旧小部件的 FLA 文件具有 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 语法吗? ?

谢谢..

I'm converting an old Captivate 4, Actionscript 2 GoToSlide widget to Captivate 5 and Actionscript 3.

The FLA file of the old widget when opened in Flash has Actionscript 2 code including the following extract sitting at top level of the file timeline. The third last line of the following evidently controls the colour of the text on rollover:

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

I can't find any comparable point in the equivalent Actionscript 3 GoToSlide Flash file to define the text color for the rollover. Can anyone help me locate it, and help with the equivalent AS3 syntax for txt_fmt.color = 0xffff00; ?

Thank you..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

┊风居住的梦幻卍 2024-12-11 10:11:08

所以几周后...

在 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

                    }

这不实际上回答了我原来的问题 - 因为它不会改变文本颜色..(对我来说,目前仍然处于太难的篮子中:我认为你必须定义一个自定义组合框或列表框组件才能做到这一点)..但是它确实控制其他组合框参数 - 下拉宽度、行高、字体等。

So after a few weeks ...

Within the Actionscript in the FLA file for the GoToSlide widget - which seems to be a variant on the combobox and listbox components - For the loop that populates the combobox dropdown, I put this:

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

                    }

This doesn't actually answer my original question -- in that it doesn't change the text colour .. (For me that was still in the too-hard basket for the moment: I think you have to define a custom combobox or listbox component to do that) .. But it does control other combobox parameters - dropdown width, rowHeight, font, etc.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文