so I am trying to program a scrolling movie clip that basically moves across the screen, and gets duplicated, and added to the end to create an infinite loop.
The logic Im using is an enterframe function that does two things:
1 incrementally moves the clip across the stage
2 checks the clips _x position, once it passes that position, it fires a function duplicating the clip, positioning its x and y, and then that calls another function to move it along the screen.
Im really trying to understand the logic, so if my logic is off, please advise me in the right direction… and here is the code…
thumbsClip.onEnterFrame = function() {
this._x ++;
if(thumbsClip._x == -150) {
addClip();
}
}
function addClip() {
//attachMovie("ThumbsClip", "instance2", this.getNextHighestDepth(), {_x:-744, _y:-33});
duplicateMovieClip("ThumbsClip", "ThumbsClipB", this.getNextHighestDepth());
ThumbsClipB._x = -100;
ThumbsClipB._y = -33;
//trace("duplicated");
trace(ThumbsClipB._x)
runDup();
}
function runDup() {
ThumbsClipB._x ++;
trace("clipB moving");
}