2

This is what I am trying to achieve but I do not remember the syntax in AS2 if someone could 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

user774411
  • 1,749
  • 6
  • 28
  • 47
SixfootJames
  • 1,841
  • 5
  • 26
  • 42

1 Answers1

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

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

Amino
  • 563
  • 1
  • 9
  • 26