Have been working on a image gallery but I ended up screwing myself over. Now I need to make it infinite and I tried a few variations but no luck.
Anyone have an idea, either I fix or I redo the darn thing.
MovieClip.prototype.easeX = function (x)
{
this.onEnterFrame = function ()
{
this._x = x - (x - this._x) / 1.200000;
if (Math.abs(x - this._x) <= 0.500000)
{
delete this[“onEnterFrame”];
this._x = x;
} // end if
};
};
images = new Array();
xml_file = “images.xml”;
xmlload = new XML();
xmlload.ignoreWhite = true;
xmlload.onLoad = function (ok)
{
if (ok)
{
count = this.firstChild.childNodes.length;
var _l2 = 0;
while (_l2 < count)
{
curNode = this.firstChild.childNodes[_l2];
images[_l2] = {caption: curNode.childNodes[0].firstChild.nodeValue, path: curNode.childNodes[1].firstChild.nodeValue};
_l2++;
} // end while
boot();
}
else
{
trace("Could not load " + xml_file + “.”);
} // end if
};
xmlload.load(xml_file);
spacing = 20;
boot = function ()
{
var _l2 = 0;
while (_l2 < images.length)
{
mc = container.attachMovie(“thumbMC”, “thumb” + _l2, _l2);
mc._x = _l2 * (50+ spacing);
mc.path = “thumbs/” + images[_l2].path + “.jpg”;
mc.link = “images/” + images[_l2].path + “.jpg”;
mc.caption = images[_l2].caption;
_l2++;
} // end while
this._parent.picture._alpha = 0;
this._parent.caption._alpha = 0;
this._parent.picture.loadMovie(“images/” + images[0].path + “.jpg”);
this._parent.caption.txt = images[0].caption;
setRollOver();
};
setRollOver = function ()
{
this.onEnterFrame = function ()
{
if (this.mask.hitTest(_root._xmouse, _root._ymouse))
{
slideMenu();
} // end if
};
};
slideMenu = function ()
{
diff = _parent._xmouse - this._x;
scale = diff * 1000 / this.mask._width;
target = -scale * (this.container._width - this.mask._width) / 930;
this.container.easeX(target);
this.slideStroke.easeX(diff);
};