new Tween () in as 2.0
Hello. Normally I use AS3 for all my coding needs ... however today I'm working for a customer that requires that I do their ad banners in AS2 so, I'm scratching my head on even the simple stuff ...
I'm trying to do a dynamic tween that is triggered by the onRelease event. The end destination of the tween will be dynamiclly set each time the left or right arrow button is clicked ... what will happen is, a long movieClip filmstrip containing different images will scroll to the appropriate _x coordinate to align the correct image. My trouble is with my syntax I think ... because Flash is completely blowing off the tween event. If you look at the code below, the one line that I have commented out (//sectionsStrip_mc._x = endX_right;), that was just a temporary work around to see if everything else works. It definitely does ... That is, If I leave out the tween all together and just update my _x property with new values, it works. Now I 'd like to get it to animate with the Tween class. The way I have it below, it just doesn't acknowledge the tween. I'm wondering (even though I Googled it already) if maybe that tween statement construct that I have is exclusive to AS 3.0?
Here's my code for the rightButton_mc. There will also be a left button to move the filmstrip left, but I figured I could just get the rightButton_mc up and running first.
//---determine "end" variable
on (release) {
if(sectionsStrip_mc._x == 0){
endX_right = -450;
filmTweenRight();
} else if(sectionsStrip_mc._x == -450){
endX_right = -900;
filmTweenRight();
} else if(sectionsStrip_mc._x == -900){
endX_right = -1350;
filmTweenRight();
} else if(sectionsStrip_mc._x == -1350){
endX_right = -1800;
filmTweenRight();
}
//---tweeningfunction
function filmTweenRight()
{
//sectionsStrip_mc._x = endX_right;
new Tween(sectionsStrip_mc, "_x", Regular, sectionsStrip_mc, endX_right, 1, true);
}
}