maxdido
%Europe/Berlin %484 %2006, 11:37
Ik heb nu toch iets vreemds ontdekt !!!
Als ik mijn site www.lucubaghs.com/demo/index.html op een computer met flash versie 8.0.24 bekijk zie ik dat de preloader goed werkt. Maar wanneer ik deze bekijk met flash versie 8.0.34 of hoger (v9) dan krijg ik, waar ik het percentage normaal gesproken zie oplopen tot 100%, infinity% te zien? Wat heb ik dan in gods naam verkeerd gedaan?? Bij portfolio --> landscapes --> foto 6 kun je het goed bekijken dit is een plaatje van meer dan 1 MB groot, dus hier moet je de procenten goed zijn oplopen (maar ik zie dus infinity%).
dit is de code die ik gebruik in frame 1:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
dimensionX = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
dimensionX[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("portfolio-landscapes.xml");
/////////////////////////////////////
p = 0;
//////////////////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
// 160 = 145 menubalk + 5 kader links + 2x witrand rondom de foto's
_root.w = Number(dimensionX[p])+160;
imageholder._alpha = 0;
imageholder.mcimage.loadMovie(image[p], 1);
mcinfo.desc_txt.text = description[p];
picture_num();
preloadthing();
}
}
function prevImage() {
if (p>0) {
p--;
_root.w = Number(dimensionX[p])+160;
imageholder._alpha = 0;
imageholder.mcimage.loadMovie(image[p], 1);
mcinfo.desc_txt.text = description[p];
picture_num();
preloadthing();
}
}
function firstImage() {
imageholder.mcimage.loadMovie(image[0], 1);
mcinfo.desc_txt.text = description[0];
_root.w = Number(dimensionX[0])+160;
imageholder._alpha = 0;
picture_num();
preloadthing();
}
function picture_num() {
current_pos = p+1;
mcinfo.pos_txt.text = current_pos+"/"+total;
}
/////////////////////////////
function preloadthing() {
this.onEnterFrame = function() {
filesize = imageholder.mcimage.getBytesTotal();
loaded = imageholder.mcimage.getBytesLoaded();
percentage = Math.floor((loaded/filesize)*100);
preloader._visible = true;
if (loaded != filesize && loaded > 0) {
preloader.progressbar._xscale = percentage;
// set the percentage dynamic textfield
preloader.progresstxt.perc.text = percentage+"%";
}
else if (loaded == filesize && filesize > 0){
preloader._visible = false;
// done loading image so now we can resize.
// centerpoint of the movieclip "mcimage" to be set as you wish.
mcimageX = 380;
mcimageY = 245;
// now we get the size of the image
imgwidth = imageholder.mcimage._width;
imgheight = imageholder.mcimage._height;
// finally, set new _x and _y position to center the image to the centerpoint
imageholder.mcimage._x = mcimageX-(imgwidth/2);
imageholder.mcimage._y = mcimageY-(imgheight/2);
if (_root.win._width == _root.w && imageholder._alpha<100) {
imageholder._alpha += 10;
}
}
}
}
Wie kan mij hiermee helpen.
Alvast bedankt.
Max.
Als ik mijn site www.lucubaghs.com/demo/index.html op een computer met flash versie 8.0.24 bekijk zie ik dat de preloader goed werkt. Maar wanneer ik deze bekijk met flash versie 8.0.34 of hoger (v9) dan krijg ik, waar ik het percentage normaal gesproken zie oplopen tot 100%, infinity% te zien? Wat heb ik dan in gods naam verkeerd gedaan?? Bij portfolio --> landscapes --> foto 6 kun je het goed bekijken dit is een plaatje van meer dan 1 MB groot, dus hier moet je de procenten goed zijn oplopen (maar ik zie dus infinity%).
dit is de code die ik gebruik in frame 1:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
dimensionX = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
dimensionX[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("portfolio-landscapes.xml");
/////////////////////////////////////
p = 0;
//////////////////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
// 160 = 145 menubalk + 5 kader links + 2x witrand rondom de foto's
_root.w = Number(dimensionX[p])+160;
imageholder._alpha = 0;
imageholder.mcimage.loadMovie(image[p], 1);
mcinfo.desc_txt.text = description[p];
picture_num();
preloadthing();
}
}
function prevImage() {
if (p>0) {
p--;
_root.w = Number(dimensionX[p])+160;
imageholder._alpha = 0;
imageholder.mcimage.loadMovie(image[p], 1);
mcinfo.desc_txt.text = description[p];
picture_num();
preloadthing();
}
}
function firstImage() {
imageholder.mcimage.loadMovie(image[0], 1);
mcinfo.desc_txt.text = description[0];
_root.w = Number(dimensionX[0])+160;
imageholder._alpha = 0;
picture_num();
preloadthing();
}
function picture_num() {
current_pos = p+1;
mcinfo.pos_txt.text = current_pos+"/"+total;
}
/////////////////////////////
function preloadthing() {
this.onEnterFrame = function() {
filesize = imageholder.mcimage.getBytesTotal();
loaded = imageholder.mcimage.getBytesLoaded();
percentage = Math.floor((loaded/filesize)*100);
preloader._visible = true;
if (loaded != filesize && loaded > 0) {
preloader.progressbar._xscale = percentage;
// set the percentage dynamic textfield
preloader.progresstxt.perc.text = percentage+"%";
}
else if (loaded == filesize && filesize > 0){
preloader._visible = false;
// done loading image so now we can resize.
// centerpoint of the movieclip "mcimage" to be set as you wish.
mcimageX = 380;
mcimageY = 245;
// now we get the size of the image
imgwidth = imageholder.mcimage._width;
imgheight = imageholder.mcimage._height;
// finally, set new _x and _y position to center the image to the centerpoint
imageholder.mcimage._x = mcimageX-(imgwidth/2);
imageholder.mcimage._y = mcimageY-(imgheight/2);
if (_root.win._width == _root.w && imageholder._alpha<100) {
imageholder._alpha += 10;
}
}
}
}
Wie kan mij hiermee helpen.
Alvast bedankt.
Max.