AS2 to AS3 conditional movie clip function


i had as2 script fade out movie clips except rolled on one. trying implement script in as3, can't seem make work. can please tell me i'm going wrong?? thanks!

 

here's as2 script:

 

function alpha(obj) {

for (var = 1; i<=24; i++)

{

if (obj._name != "p"+i)

{

var box_tween:object = new tween(_root.port["p"+i], "_alpha", regular.easeinout, 100, 40, 1, true);

} else

{

obj._alpha = 100;

 

}

}

}

 

 

here's attempt @ translating as3:

 

function onbuttonover(e:mouseevent):void{

 

for (var i:number = 1; i<=4; i++)

{

 

if (e.currenttarget != "p"+i)

{

 

var entertween:tween = new tween(["p"+i], "alpha", none.easeout, 1, .4, 1, true);

 

} else

{

e.currenttarget.alpha = 1;

}

}

try:

 

 

var tl:movieclip = this;   function onbuttonover(e:mouseevent):void {       (i:int = 1; i<=4; i++) { if (e.currenttarget != tl["p"+i]) { var entertween:tween = new tween(tl["p"+i], "alpha", none.easeout, 1, .4, 1, true); } else { e.currenttarget.alpha = 1; } } } 


More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Flip address is out of range arduino uno r3

Arduino Uno not uploading

Indesign and MathType fonts