Hi list,

I'm having a problem with a regular infinite scroll. I have the same code in 3 different fla's and it's working on 2 of them only and I can't find what's causing the problem

The problem is that it get itself playing both the 'if's' when it's scrolling to the right ( or if I change the if order, it stops when it's scrolling to the left)

Here's the code from the fla that is working:

var speedLimiter:Number = 25;
var colStartX:Number = colScroll_mc._x;
var space:Number = 20;
var scrollReset:Number = colStartX - colScroll_all_mc._width - space;

function initColScroll() {
var colScroll_all2_mc:MovieClip = colScroll_all_mc.duplicateMovieClip('colScroll_all2_mc', this.getNextHighestDepth()); colScroll_all2_mc._x = colScroll_all_mc._x + colScroll_all_mc._width + space;
colScroll_mc.setMask(colScrollMask_mc);
this.onEnterFrame = function() {
var point:Object = {x:_xmouse, y:_ymouse};
localToGlobal(point);
var isOverMask:Boolean = colScrollMask_mc.hitTest(point.x, point.y);
if (isOverMask) {
var moveScroll:Number = colScrollMask_mc._xmouse;
colScroll_mc._x -= (moveScroll - (colScrollMask_mc._width / 2)) / speedLimiter;
if (colScroll_mc._x >= colStartX) {
colScroll_mc._x = scrollReset;
}
if (colScroll_mc._x <= scrollReset) {
colScroll_mc._x = colStartX;
}
}
};
}

initScroll()

And here's the code for the page that isn't working ( only the part between the if(isOverMask)), all the other stuff is equal

if (isOverMask) {
var moveScroll:Number = capasMasks_mc._xmouse;
capas_mc._x -= (moveScroll - (capasMasks_mc._width / 2)) / speedLimiter;
trace(capasStartX + '>=' + capas_mc._x + '<= ' + scrollReset);
if (capas_mc._x <= scrollReset) {
capas_mc._x = capasStartX;
}
if (capas_mc._x >= capasStartX) {
capas_mc._x = scrollReset;
}
}

also I've uploaded the one who isn't working to http://www.zerocinco.com.br/bottero/scroll/

Please advice

[]´s
Marcelo Wolfgang
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to