Hey everyone!
So i was able to utilize the Flashlevel nav and make it do ALMOST exactly what I need it to do but I just need a little help.
You can take a look here: http://www.globalstudio.com/cody/menu/
The original Flashlevel nav ran vertically so I made this one horizontal and also I took out the ability to move the images with the mouse position. Instead I utilized a left and right arrow so you can move the images as a group.
Ok this is the thing that is bugging me:
I would like it if it would only display 4 images at a time and when you click the right arrow it will move the whole thing over to reveal the next 4 and have some elasticity to it. So it wont just jump right to the next 4 like I have my example doing.
Here is my code:
MovieClip.prototype.easeY = function(x) {
this.onEnterFrame = function() {
this._x = x-(x-this._x)/1.2;
if (Math.abs(x-this._x)<=1) {
//delete this.onEnterFrame;
this._x = x;
}
};
};
images = new Array();
xml_file = "images.xml";
xmlload = new XML();
xmlload.ignoreWhite = true;
xmlload.onLoad = function(ok) {
if (ok) {
count = this.firstChild.childNodes.length;
for (var i = 0; i<count; i++) {
curNode = this.firstChild.childNodes*;
images* = {path:curNode.childNodes[0].firstChild.nodeValue,link:curNode.childNodes[1].firstChild.nodeValue,caption:curNode.childNodes[2].firstChild.nodeValue};
}
boot();
} else {
trace("Could not load "+xml_file+".");
}
};
xmlload.load(xml_file);
// ------------------------------------------------------------
spacing = 5;
boot = function () {
for (var i = 0; i<images.length; i++) {
mc = container.attachMovie("thumbMC", "thumb"+i, i);
mc._x = i*(160+spacing);
mc.path = images*.path;
mc.link = images*.link;
mc.over.captionMC.caption.text = images*.caption;
}
setRollOver();
};
setRollOver = function () {
this.onEnterFrame = function() {
if (this.mask.hitTest(_root._xmouse, _root._ymouse)) {
slideMenu();
}
};
};
arrow_right.onRelease = function(){
var xDest = container._x - 100;
container._x += (xDest - container._x)/.151;
}
arrow_left.onRelease = function(){
if(this.container._x >= -213){
container._x = -213;
} else {
var xDest = container._x + 100;
container._x += (xDest - container._x)/.151;
}
}
If you would like to download my source files you can download it here: http://www.globalstudio.com/cody/menu/menu.zip
Btw: Thanks to Tempest811 for helping me with the AS for the arrows.