This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Flash Site Design > November 2007 > HELP!! simple gallery !





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author HELP!! simple gallery !
Val Figallo

2007-11-17, 10:15 pm

hey everyone, i have made this gallery tutorial..and it works ok, but when i
put a preloader, the preloader just doesnt work, i downloaded the fla source in
the tutorial and tried to put a preloader but doesnt work too...i really need
help on this..please!


http://http://www.flash-game-design...lash-tutorial.h
tml

thank you very much,

Val

Sketchsta

2007-11-18, 6:14 am

Place your code here, and we can help you.
Val Figallo

2007-11-18, 6:15 pm

ok :), the script of the gallery is:

this.createEmptyMovieClip("images", 100);
this.attachMovie("mask", "mask", 101);
mask._x = images._x =-0.9;
mask._y = target = 143.9;
images.setMask(mask);
images._y = -1000;
speed = 5;
for (var i = 0; i<8; i++) {
var img = images.attachMovie("image"+i, "image"+i, i);
img._y = img._height*i;
var thumb = this["thumb"+i];
thumb._alpha = 60;
thumb.pos = target+(i*-img._height);
thumb.onPress = function() {
target = this.pos;
};
thumb.onRollOver = function() {
this._alpha = 100;
};
thumb.onRollOut = function() {
this._alpha = 100;
};
}
this.onEnterFrame = function() {
images._y += (target-images._y)/speed;
};



--------------------------------------------------------------------------------
-------

Preloader Code:

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*50 ;
this.loadBar2._width = getPercent*50 ;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
this.gotoAndPlay(3);
}

Sketchsta

2007-11-19, 6:15 pm

I dont see anything wrong with the code, nor the pre-loader code. But I think i
know what you mean by it's not working..

a) you dont have a stop(); action on frame 3. This will cuse your playhead to
loop back to frame 1, there your if() statement will be true ( bytes_loaded ==
bytes_total) and it will goto frame 3, and then back to frame 1, and so on...

adding a stop(); action on frame 3 should stop this.

b) another thing, i dont know exactly how this will affect your pre-loader,
but your images are being attached dynamically. which tells me that a
pre-loader at the beginning of your timeline might be pointless. as your images
are being loaded AFTER your pre_loader is checking bytes_loaded and bytes_total.

I could be wrong about that tho.. so check a:) first, if that doesnt solve
your problem, let me know, and i'll have another look.

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews