2

我有这段代码,当我翻转链接动画剪辑时,它应该改变动态文本字段的颜色,然后在我推出时返回。我没有得到编译器错误,它只是不起作用。

function textColor(mc_function:MovieClip, tf_text:TextField) {
mc_function.onRollOver = function() {
    tf_text.textColor = 0x7cb0b7; 
};
mc_function.onRollOut = function() {
    tf_text.textColor = 0xffffff; 
};
}

boxLink(link_a1,text_a1);
boxLink(link_a2,text_a2);
boxLink(link_a3,text_a3);

有什么想法吗?

4

1 回答 1

1

试试这个:

function SetMouseAction(pMovieClip, pTextField):Void {
    pMovieClip.linkedText = pTextField;
    pMovieClip.onRollOver = function() {
            this.linkedText.textColor = 0x7cb0b7; 
    };
    pMovieClip.onRollOut = function() {
            this.linkedText.textColor = 0xffffff; 
    };
}

SetMouseAction(link_a1, text_a1);
SetMouseAction(link_a2, text_a2);
SetMouseAction(link_a3, text_a3);

至少我已经测试过了,它对我有用

于 2009-03-25T09:04:39.160 回答