I have a big problem, no matter how hard i try i cant get my imageviewer to preload proberly.
Im a kind of newbie in AS so i have made my imageviewer by my self (a mix of tutorials )
I really hope that any of you can explayn or show me how i could get this imageview to preload proberly...
i have split my code up:
My viewer has thumbnails, and a big preview.
here the xml part:
viewImg = new XML();
viewImg.ignoreWhite = true;
viewImg.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
loaderto.loadMovie(this.firstChild.childNodes[i].attributes.main);
fadeTo(loader, 0, 100, 1);
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = (i-numimages)*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.attachMovie("line", "hover", 2);
this.thumbHolder.hover._visible = false;
title_txt.text = (this.firstChild.childNodes[i].attributes.title);
this.thumbHolder.onRollOver = over;
this.thumbHolder.onRollOut = out;
this.thumbHolder.onRelease = klik;
}
thumbnails.thumbnail0.onRelease();
}
viewImg.load("../photo/REOLER/2/view.xml");
My Thumbnails have these functions:out = function() {
if (this.selected) return;
this.hover._visible = false;
}
over = function() {
if (this.selected) return;
this.hover._visible = true;
}
klik = function() {
if (last_selected) {
last_selected.selected = false;
last_selected.hover._visible = false;
}
last_selected = this;
this.selected =true;
this.hover._visible = true;
if (valg == true) {
valg = false
} else {
valg = true
}
if(valg==true) {
loader.loadMovie(this.main);
fadeTo(loaderto, 100, 0, 1);
fadeTo(loader, 0, 100, 1);
trace("valg er nu: "+valg);
} else {
loaderto.loadMovie(this.main);
fadeTo(loaderto, 0, 100, 1);
fadeTo(loader, 100, 0, 1);
trace("valg er nu: "+valg);
}
title_txt.text = this.title;
}
Is it possible to place a preloader in this scrpt... and how.?Best Regards
rosenberg
