Hi this is my code. I’m using tweener for some animations but for some reason I can’t get it to work with movie clip duplicates. The duplicate is called mainWave0 and I can do things like get the _x value but I can’t get the tweener code to work on it in the enterframe function. However the tweener code in doWaveAniA manipulates the clip correctly. Basically all I want to do is loop it from right to left.
Thanks and heres the piece of relevant code.
var total = 1;
for (i=0; i<total; i++) {
duplicateMovieClip(mainWaveA, “mainWave”+i, i);
_root[“mainWave”+i]._y = 325+5*i;
}
// Basically a listener for the waves position change…this works for mainWaveA but not mainWave0
mainWaveA.onEnterFrame = function() {
if (this._x != this.oldx && this._x == -988) {
Tweener.addTween(mainWaveA,{_x:0, time:0, delay:0, transition:“linear”});
Tweener.addTween(mainWave0,{_x:0, time:0, delay:0, transition:“linear”});
}
// adjust the time below for a natural lookingwave
if (this._x != this.oldx && this._x == 0) {
Tweener.addTween(mainWaveA,{_x:-988, time:1, delay:0, transition:“linear”});
Tweener.addTween(mainWave0,{_x:-988, time:0, delay:0, transition:“linear”});
}
this.oldx = this._x;
};
doWaveAniA();
function doWaveAniA() {
findRandNum();
Tweener.addTween(mainWaveA,{_yscale:myRandNum, time:myspeed, delay:0, transition:transitionType});
Tweener.addTween(mainWave0,{_yscale:myRandNum, time:myspeed, delay:0, transition:transitionType});
}
setInterval(doWaveAniA,1000);