Thanks for the great responses, you maybe right about the structure or architectural setup.
Currently using version 11, but only because I have a very long animation I don't want to have to go through and update with new code yet.
I did come up with a solution by applying my function in the tween length value instead of using a variable:
myTimeline.append(TweenMax.to(mc, calcSpeedx(location01_x, location02_x), {x:location02_x, delay:animDelay, ease:animEase}));
myTimeline.append(TweenMax.to(mc, calcSpeedx(location02_x, location03_x), {x:location03_x, delay:animDelay, ease:animEase}));
function calcSpeedx(startLocation_x, endLocation_x:Number):Number
{
return Math.abs((endLocation_x - startLocation_x) / speed_x);
}
This works fine, however I notice it does go through all the appended tweens simultaneously when creating the timeline, which I assume logically is correct. I was ideally hoping it would calculate the length of the tween, play it and move onto the next tween in sequence.
As I'm fairly new to this, I'm not sure if its the right way or ideal way of doing this.
Thanks again for your suggestions, I'll look at those next and see if they are a better solution.