I have the following weird problem, which is not caused on the alpha only, also on changes of the _x or _y property of an mc.
Say I have 10 movie clips, and a little for loop that moves though each of the movie clips and changes something about their properties, for example
mc = movie clip array()
for(var m=0; m< mc.length; m++){
for(var i=100; i<=0; i--){
mc[m]._alpha = i;
}
}
This causes all the movie clips to “turn of” at once, the user doesn’t see the transition, it also happens if I change the _y or _x value, the mc just shows up at the final location without moving towards it.
Note: This code is in an external AS class, if you would like me to post it, say so, but it won’t help in the current problem.
So to conclude, can anybody tell me how on earth, without using setInterval, to show the gradual process of changing a property of an mc. Or am I missing something???
This question is very stupid, I know, but trust me, It has been anoying me for the las couple of days :-).
Yeah. I can help.
Your problem is this: You use a for loop.
Technically, the program does everything you want.
But it happens so fast that nobody ever sees it. (well, really, it doesn’t get updated fast enough, so there’s nothing to see.)
What you need is a function that reduces the _alpha by one.
function fade(mc:MovieClip){
mc._alpha–;
}
then you need to call it using setInterval, or onClipEvent, but your header says no onClipEvent.
fade = new mx.transitions.Tween(movieClipName, “_alpha”, mx.transitions.easing.None.easeNone, 0, 100, .5, true);
movieClipName = name of your movie clip
0 = start alpha at 0
100 = end alpha at 100
.5 = number of seconds for alpha change to last, in this case, .5
true = whether or not the .5 is seconds or frames