开发者

How to attach a number to a movie clip

This is what I am trying to achieve but I do not remember the syntax in AS2 if someone c开发者_JAVA百科ould please help.

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

The newId, is what I am trying to attach to _glow.

If I hard code this value i.e. _glow0 or _glow1, this works but this value needs to be dynamic, in order to get the rollover state working. per highlightCan();

Thanks


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

when you call the highlightCan() you must send the ID number e.g.: highlightCan(2) will make transition on _parent._glow2._alpha

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜