如何将数字附加到影片剪辑

时间:2011-10-03 09:19:07

标签: actionscript-2 flash-cs3

这是我想要实现的目标,但如果有人可以帮忙,我不记得AS2中的语法。

public function highlightCan() {
    var glowId = String(this);
    var newId = glowId.substring(47);
    trace ("newId : " + newId); 
    new Tween(_parent._glow["newId"], "_alpha",    
    mx.transitions.easing.None.easeNone, _parent._glow0._alpha, 100, 2, false);
}

newId,是我想要附加到_glow。

如果我对此值进行硬编码,即_glow0或_glow1,则此方法有效,但此值必须是动态的,以便使翻转状态有效。 per highlightCan();

由于

1 个答案:

答案 0 :(得分:0)

public function highlightCan( id:Number ) {

 var glowId = String(this);
    var newId = glowId.substring(47);
    trace ("newId : " + newId); 
    new Tween(_parent._glow["newId"], "_alpha",    
    mx.transitions.easing.None.easeNone,

<强> eval("_parent._glow"+id)._alpha , 100, 2, false); }

当您致电highlightCan()时,您必须发送ID number例如:highlightCan(2)将在_parent._glow2._alpha进行转换