A strange issue is plagueing me today. I’m using a slightly modified version of the Kirupa XML gallery + Thumbnail bar. When scrolling in Explorer, the speed is only a fraction of what its supposed to be. Firefox handles it as expected.
For an example, see here:
When using the buttons above and below the thumbnail bar on the right side, you’ll notice it moves at sluggish speeds in Explorer while things are quite acceptable in Firefox.
I’ve been toying with the action script to get things to work properly, but the best I can do is either break scrolling completely or have IE at normal speed while FF switches to turbo-scroll.
If someone would be willing to have a look at the code, I’d be quite grateful.
To be on the safe side, I simply included all code and bolded the area where I think the issue lies.
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("Beelden.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
picture._x = 366-picture._width/2;
picture._y= 176-picture._height/2;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.html = true;
desc_txt.htmlText = description[p];
var format:TextFormat = new TextFormat();
format.align = "center";
desc_txt.setTextFormat(format);
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.htmlText = description[p];
picture_num();
}
}
function firstImage() {
setProperty(previous_btn,_alpha,100);
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
// thumbnail code!
**function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
}
onMouseDown = function () {
MouseDown = true;
}
onMouseUp = function () {
MouseDown = false;
}
function moveRight() {
if ((thumbnail_mc.hitTest(Down))) {
thumbnail_mc._y--;
} else {
delete tscroller.onEnterFrame;
}
}
function moveLeft() {
if ((thumbnail_mc.hitTest(Up))) {
thumbnail_mc._y++;
} else {
delete tscroller.onEnterFrame;
}
}
Down.onPress = function() {
moveRightID = setInterval(moveRight, 1);
};
Down.onRelease = function() {
clearInterval(moveRightID);
};
Up.onPress = function() {
moveLeftID = setInterval(moveLeft, 1);
};
Up.onRelease = function() {
clearInterval(moveLeftID);
};**
var mouseListener:Object = new Object();
mouseListener.onMouseWheel = function(delta) {
if (delta > 0) {
if ((thumbnail_mc.hitTest(Up))) {
thumbnail_mc._y = thumbnail_mc._y + (delta * 10);
} else {
delete tscroller.onEnterFrame;
}
}
if (delta < 0) {
if ((thumbnail_mc.hitTest(Down))) {
thumbnail_mc._y = thumbnail_mc._y + (delta * 10);
} else {
delete tscroller.onEnterFrame;
}
}
}
Mouse.addListener(mouseListener);
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._y = Up._y+(eval("thumbnail_mc.t"+k)._height+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
//getURL("javascript:changeZback()");
//setProperty(previous_btn,_x,133);
//setProperty(next_btn,_x,636);
removeMovieClip(Mask);
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}