futuraprime
March 17th, 2009, 11:59 AM
I have a flash movie which has a bar chart that changes depending on what the user clicks on. The change is handled through a tween, which ends up running about 50 tweens at once. Occasionally, and in (as far as I can tell) an unpredictable manner, the tweens just stop partway through. Can anyone explain why this is happening?
For reference, here's the code I use to tween them:
function changeBarGraph(abbr) {
for (var month in states[abbr][selectedTab.key]) {
var this_bar = bar_graph[month];
var this_bar_height = (states[abbr][selectedTab.key][month] - selectedTab.adjust) * 2000;
var tween_duration = .5;
var barHeightTween:Tween = new Tween(this_bar, "height", Regular.easeOut, this_bar.height, this_bar_height, tween_duration, true);
}
}It works about 95% of the time.
Thanks.
For reference, here's the code I use to tween them:
function changeBarGraph(abbr) {
for (var month in states[abbr][selectedTab.key]) {
var this_bar = bar_graph[month];
var this_bar_height = (states[abbr][selectedTab.key][month] - selectedTab.adjust) * 2000;
var tween_duration = .5;
var barHeightTween:Tween = new Tween(this_bar, "height", Regular.easeOut, this_bar.height, this_bar_height, tween_duration, true);
}
}It works about 95% of the time.
Thanks.