开发者

How to attach a number to a movie clip

开发者 https://www.devze.com 2023-04-10 20:19 出处:网络
This is what I am trying to achieve but I do not remember the syntax in AS2 if someone c开发者_JAVA百科ould please help.

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

精彩评论

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

关注公众号