I have been trying to figure this problem out for a while and can’t seem to get it to work the way I want, I think I am on the right track, just missing something!
Could someone help me take the thumbnail scroller from this Kirupa tutorial (http://www.kirupa.com/developer/mx2004/thumbnails.htm) and make it an inifinite scroll? I have tried incorporating the idea from this other tutorial (http://www.kirupa.com/developer/mx/infinite.htm) but like I said, I can’t seem to get it to work!
Here is my code… I have tweaked it quite a bit as I can’t use XML and just want to scroll a movieclip!
[COLOR=Red]this.createEmptyMovieClip(“tscroller”, 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>0) && (_root._xmouse>=(hit_right._x-100)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
thumbnail_mc._x= -1200;
} else if ((_root._xmouse< -1200) && (_root._xmouse<=(hit_left._x+100)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
thumbnail_mc._x=0;
}
} else {
delete tscroller;
}
};[/COLOR]
I also tried this…
[COLOR=Red]this.createEmptyMovieClip(“tscroller”, 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-100)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
if (_root._xmouse>0){
thumbnail_mc._x= -1200;}
} else if ((_root._xmouse<=(hit_left._x+100)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
if (_root._xmouse< -1200){
thumbnail_mc._x=0;}
}
} else {
delete tscroller;
}
};[/COLOR]