fadein - stop fade in out on a movieclip actionscript 2 -
i'm trying stop fading in/out movieclip.
i'll explain: i've integrated swf in html page dropdown list. when choose item list javascript function it's called.this function execute callback function in swf file fade in/out image drawn @ runtime (depending on item selected in dropdown list). when choose element want previuos item stops fading , new starts.
this fading function:
function fadein(h){ if (eval(h)._alpha<100) { eval(h)._alpha += 20; } else { clearinterval(fadeinterval); settimeout(startout, 500, h); } } function fadeout(h) { if (eval(h)._alpha>0) { eval(h)._alpha -= 20; } else { clearinterval(fadeinterval); settimeout(startin, 100, h); } } function startout(h) { fadeinterval = setinterval(fadeout, 1, h); } function startin(h){ fadeinterval = setinterval(fadein, 1, h); } function flashing(h){ var bname; bname = "plangroup.singleobject." + h; eval(bname)._alpha = 0; fadeinterval = setinterval(fadein, 1, bname); }
i tried clearinterval(fadeinterval)
, doesn't work, tried my_mc.stop()
doesn't work either.
i tried set variable count execute fading olny 5 times, , work unless change item in drowpdown list before function complete.
any ideas?? hope clear!
thanks
if cares solved tween class!! functions replaced 1 line of code:
function fadeto(clipname, fadevalue){ new mx.transitions.tween(eval(clipname), "_alpha", mx.transitions.easing.regular.easeout, eval(clipname)._alpha, fadevalue, 1, true); }
Comments
Post a Comment