Infinate scroller
does know how can make image scroller inifate, 1 big loop, , how slow down?
thanks
stop(); //build gallery (i = 0; < total; i++){ contentmc.attachmovie("attachmc", "images" + i, i); path = contentmc["images" + i]; path._x = contentlength * i; path.title_txt.htmltext = title[i]; path.caption_txt.htmltext = caption[i]; path.caption_txt.autosize = true; contentlength = space[i]; path.linkbutton._link = link[i]; loadmovie(image[i], path.holdermc); // linkbutton setting [ active & pasif ] if (link[i] != null && link[i] != " " && link[i] != undefined){ path.linkbutton._visible = true; }else{ path.linkbutton._visible = false; } }//end scrolltspeed = 0.1; //slider control move var speedy:number = 10; //setmask contentmc.setmask(maskmc); // scroll slide function function slidefunction() { if(this._ymouse>0 && this._ymouse<maskmc._height) { if(this._ymouse>0 && this._ymouse<maskmc._width) { speedy = -this._xmouse/maskmc._width*(contentmc._width-maskmc._width); } } contentmc._x +=( speedy-contentmc._x )* scrolltspeed; } onenterframe = function() { slidefunction(); }; // resize objects of stage stage.align = "tl"; stage.scalemode = "noscale"; stagelistener = new object(); stage.addlistener(stagelistener); resizeobjects = function () { backgroundmc._x = 0; backgroundmc._y = 0; backgroundmc._width = stage.width; backgroundmc._height = stage.height; maskmc._x = 0; maskmc._y = 0; maskmc._width = 1000; //stage.width; maskmc._height = stage.height; contentmc._x = 0; contentmc._y = stage.height / 2 - contentmc._height / 2; } stagelistener.onresize = function() { resizeobjects(); } resizeobjects();
to control speed adjust scrolltspeed. make infinite, add enough contentmc left side of contentmc on right side of contentmc. need maskmc._width's worth of duplicates. when contentmc's left edge aligned maskmc's left edge reposition contentmc left-edge of duplicates on right side @ maskmc's left edge. likewise, when right edge of right side of contentmc @ right-edge of maskmc.
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment