View Full Version : Howd he do this? Resizing slideshow
kobalt7
August 18th, 2006, 10:37 PM
ive been beating at this for a week now, and im slowly but surely getting everything working, but my buttons arent working right and i could use some help and im still new to flash 8. the firstImage function works but the nextImage function works only part of the time.
flash8
http://www.kobalt7.com/2006/tst/thumbnail2b.html
http://www.kobalt7.com/2006/tst/thumbnail2b.zip
var spacing:Number = 20;
picture._alpha = 0;
preloader._alpha = 0;
MovieClip.prototype.loadPic = function(pic:String) {
this.loadMovie(pic);
preloader.what.text = "No:"+p;
preloader._alpha = 100;
picture.stop();
onEnterFrame = function () {
var filesize:Number = picture.getBytesTotal();
var loaded:Number = picture.getBytesLoaded();
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
trace("right here");
} else if (loaded == filesize && filesize != 0) {
var t:Number = picture.getBytesTotal(), l:Number = picture.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1) {
var w:Number = picture._width+spacing, h:Number = picture._height+spacing;
border.resizeMe(w, h);
preloader._alpha = preloader._alpha-20;
if (border._width == picture._width+spacing) {
picture._alpha = picture._alpha+20;
if (preloader._alpha<=0 && picture._alpha>=100 && border._width == picture._width+spacing) {
//_parent.msk.gotoAndStop(2)
image_mcl.removeListener(tlistener);
picture.gotoAndPlay(2);
delete onEnterFrame;
delete preloader.onEnterFrame;
delete this.onEnterFrame;
delete border.onEnterFrame;
picture.onRollOver = function() {
ino.dino.auton.play();
border.gotoAndStop(2);
};
picture.onRollOut = function() {
border.gotoAndStop(3);
};
picture.onRelease = function() {
getURL(link[p], "_blank");
delete onEnterFrame;
};
}
}
ino.nrr.onRollOver = function() {
ino.dino.io.gotoAndStop(2);
};
ino.nrr.onRollOut = function() {
ino.dino.io.gotoAndStop(3);
};
ino.nrr.onRelease = function() {
if (ino.dino.htmltxt != null or undefined) {
ino.dino.play();
}
};
}
}
};
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
//this.onEnterFrame = function() {
yy = picture._height;
var w = picture._width+spacing, h = picture._height+spacing;
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
mks._width += (w-mks._width)/speed;
hit_left._x += (w-this._width)/speed;
keepup._width += (w-this._width)/speed;
keepup._x = this._x-(this._width/2);
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
picture._x = this._x-this._width/2+spacing/2;
picture._y = this._y+8;
msk._width = w-spacing;
msk._height = h-10;
msk._x = this._x;
msk._y = this._y;
hit_left._x = this._x-(this._width/2)+7;
mks._width = w-32;
mks._x = this._x;
}
};
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
link = [];
info = [];
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;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
link[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
info[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
preloader.what.text = "XML";
xmlData.load("images.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();
};
/////////////////////////////////////
var p:Number = 0;
function nextImage() {
//updateAfterEvent();
if (loaded == filesize && filesize != 0) {
if (picture._alpha>=100) {
this.onEnterFrame = function() {
picture._alpha = picture._alpha-20;
preloader._alpha = preloader._alpha+20;
if (picture._alpha<=0 && preloader._alpha>=100) {
picture.stop();
if (p<(total-1)) {
p++;
picture.loadPic(image[p]);
ino.desc_txt.text = description[p];
ino.dino.htmltxt.text = info[p];
picture_num();
}
}
};
}
}
}
function prevImage() {
if (p>0) {
p--;
picture.loadPic(image[p]);
ino.desc_txt.text = description[p];
ino.dino.htmltxt.text = info[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture.loadPic(image[0]);
ino.desc_txt.text = description[0];
cap.desc.text = " "+link[0];
ino.dino.htmltxt.text = info[0];
picture_num();
thumbnail_mc.attachMovie("thumb2", "tt"+0, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.tt0.gotoAndStop(2);
}
}
function picture_num() {
var current_pos:Number = p+1;
ino.pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
var scroll_speed:Number = 10;
tscroller.onEnterFrame = function() {
if ((_ymouse>=thumbnail_mc._y) && (_ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
_x;
} else if ((_xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
var k:Number = 0;
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
var tlistener:Object = new Object();
tlistener.onLoadStart = function(target_mc:MovieClip) {
target_mc._alpha = 0;
};
tlistener.onLoadStart = function(target_mc:MovieClip) {
target_mc._alpha = 0;
};
tlistener.onLoadProgress = function(target_mc:MovieClip) {
target_mc._alpha += 10;
preloader.preload_bar._xscale = bytesLoaded/bytesTotal;
};
tlistener.onLoadComplete = function(target_mc:MovieClip) {
target_mc._alpha = 100;
thumbnail_mc.attachMovie("thumb2", "tt"+k, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.attachMovie("thumb", "test"+k, thumbnail_mc.getNextHighestDepth());
preloader.what.text = k+"thumbs";
var kl:Number = k+1;
if (kl eq total) {
preloader.what.text = "Done!";
}
};
tlistener.onLoadInit = function(target_mc:MovieClip) {
target_mc._x = (target_mc._width+5)*k;
var po:MovieClip = eval("thumbnail_mc.tt"+k);
var poo:MovieClip = eval("thumbnail_mc.test"+k);
var poop:MovieClip = eval("thumbnail_mc.t"+k);
poo._x = (poop._width+5)*k;
poo.tover.tname.text = ">"+" No: "+k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
poo.tover.tname.text = ">"+" No: "+k;
poo.gotoAndStop(4);
p = this.pictureValue-1;
po._x = (po._width+5)*k;
po._x = this._x;
po.gotoAndStop(2);
trace(po);
nextImage();
preloader.what.text = "No:"+k;
};
target_mc.onRollOver = function() {
poo.gotoAndStop(2);
poo.tover.tname.text = ">"+" No: "+k;
thumbNailScroller();
captionFN(true, description[k], this);
};
target_mc.onRollOut = function() {
poo.gotoAndStop(3);
poo.tover.tname.text = ">"+" No: "+k;
captionFN(false);
};
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
captionFN = function (showCaption, captionText, bName) {
if (showCaption && loaded == filesize) {
cap.gotoAndPlay(1);
cap.crap.setMask(cap.msk);
cap.msk.gotoAndPlay(1);
createEmptyMovieClip("hoverCaption", this.getNextHighestDepth());
cap.desc.text = " "+captionText;
cap.crap._width = 6*cap.desc.text.length;
cap._alpha = 100;
if ((bName._width+bName._x+cap._width)>border.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
cap._x = _xmouse+xo;
cap._y = _ymouse+yo;
cap._visible = true;
};
} else {
cap.gotoAndPlay(14);
delete hoverCaption.onEnterFrame;
}
};
stop();
ryanflair
August 20th, 2006, 04:37 PM
hey all, I have a very simple question. I am using V3 of the photo gallery and i was wondering how i could add a dynamic description to each photo that wouldnt be affected by the resize script. ie a description that i could place any where on the x y axis unlike the info/ title which is forced to be change spots based on the size of the photo.
thanks in advance
oh and also one last thing. can anyone help me have the description box hide and reveal like the ones in the youtube videos? ie when you roll over it pops up?
jerryj
August 20th, 2006, 07:11 PM
Remove these lines:
picinfo._y = nextb._y-5;
picinfo._x = border._x-picinfo._width/2;
and place the pic_info textfield anywhere you want on the stage.
Your other quuestion:
I think a rollOver function would do it,
something like:
picinfo._visible=false;
picinfo.onRollover=function(){
this._visible=true;
}
picinfo.onRollOut=function(){
this._visible=false;
}
Good luck,
Jerryj.
scotty
August 21st, 2006, 03:55 PM
@s9v24: if you want to use next and prev buttons, you have to change the code in the loadPic funtion. Right now variable 'pic' is the name of the jpg, it must be the number of that picture in the array.
The code bacalao gave you will work if in the loadPic function you change this line
this.loadMovie(pic);
to
this.loadMovie(pArray[pic]);
and the activateButtons function like this
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = th_nav["thmb"+i];
but.id = i;
but.onRollOver = function() {
startDrag(desc, true);
_root.desc.gotoAndStop(1);
desc.title = iArray[this.id];
};
but.onRelease = function() {
//change here
container.loadPic(this.id, iArray[this.id]);
disButtons2(this.id);
_root.desc.stopDrag();
_root.desc.gotoAndStop(2);
desc.title = "";
//important, so you know which picture is current picture
cur = this.id;
};
but.onRollOut = function() {
_root.desc.stopDrag();
_root.desc.gotoAndStop(2);
desc.title = "";
};
}
container.loadPic(0, iArray[0]);
disButtons2(0);
}
scotty(-:
kobalt7
August 22nd, 2006, 08:36 AM
?
scotty
August 22nd, 2006, 12:17 PM
@kobalt7: you have to delete the onenterframe in the nextImage function.
Maybe there's more wrong, but the code is kind of messy...
scotty(-:
InfestedDemon
August 22nd, 2006, 01:35 PM
just got to add...christ 68 pages?!?!
kobalt7
August 22nd, 2006, 03:08 PM
thanks scotty i was beginning to feel pretty lame, nobody seems to want to help me with this gallery, or anytime i need help with something, i always end up walking away because i cant get anyone to help me. I'm sorry my code is messy, I would clean it up if I could. I'm just tired after 2 weeks working on this everyday and posting to have a total of 2 people offer lil help, I tried removing the enterframe before i even posted, im wondering if i missed something if im not asking politely, or in the wrong spot, or I'm so bad that people hate me right away. At this point ive found most people who could help me wont even talk to me, im kinda bitter at this point id barter my design/animation skills for help but im not good enough.
kobalt7
August 25th, 2006, 03:02 PM
please help
ryanflair
August 29th, 2006, 12:35 PM
hey guys i was able to make it so that the title would be able to be moved anywhere on the page, however my new problem is that i wanted to add two more description text boxes, i can get them to load when you first click on thumbnail but when you go back to it later on they dont load. heres my code mabye i am just too slow to figure this out:
var tnNr;
spacing = 10;
container._alpha = 0;
var curLength;
MovieClip.prototype.loadPic = function(pic, id, tt, de, link) {
info.text = "";
ttle.text = "";
details.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id, tt, de, link);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id, tt, de, link) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
container._alpha += 5;
if (container._alpha>90) {
info.text = id;
ttle.text = tt;
details.text = de;
container._alpha = 100;
container.onRelease = function(){
getURL(link, "_blank")
}
delete this.onEnterFrame;
}
}
};
};
function galleryChoice(q) {
pArray = new Array();
tArray = new Array();
iArray = new Array();
ttArray = new Array();
dArray = new Array();
linkArray = new Array()
my_xml = new XML();
for (var j = 0; j<curLength; j++) {
this.th_nav["thmb"+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes[i].attributes.source);
tArray.push(gallery.childNodes[i].attributes.thumb);
iArray.push(gallery.childNodes[i].attributes.title);
ttArray.push(gallery.childNodes[i].attributes.ttle);
dArray.push(gallery.childNodes[i].attributes.details);
linkArray.push(gallery.childNodes[i].attributes.url);
}
}
delay = setInterval(makeButtons, 50);
};
my_xml.load("gallery.xml");
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%17*50;
thb._y = Math.floor(i/17)*50;
}
loadButtons();
}
function loadButtons() {
var tbox = th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id], ttArray[this.id]. dArray[this.id], linkArray[this.id]);
disButtons2(this.id);
};
}
container.loadPic(pArray[0], iArray[0], ttArray[0], dArray[0], linkArray[0]);
disButtons2(0);
}
butArray = new Array();
butArray = ["gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn"];
function mainButtons() {
for (var i = 0; i<butArray.length; i++) {
this[butArray[i]].id = i;
this[butArray[i]].onRelease = function() {
galleryChoice(this.id);
disButtons(this.id);
};
}
}
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
this.th_nav["thmb"+i].enabled = 1;
this.th_nav["thmb"+i].box._alpha = 100;
} else {
this.th_nav["thmb"+i].enabled = 0;
this.th_nav["thmb"+i].box._alpha = 50;
}
}
}
function disButtons(d) {
for (var i = 0; i<butArray.length; i++) {
if (i != d) {
this[butArray[i]].enabled = 1;
this[butArray[i]].gotoAndStop(1);
} else {
this[butArray[i]].enabled = 0;
this[butArray[i]].gotoAndStop(2);
}
}
}
disButtons(0);
galleryChoice(0);
scotty
August 31st, 2006, 02:12 PM
It could be a typo, but the only weird thing I see is you have a period '.' i/o a comma ',' in the activateButtons function between the ttArray and dArray:
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id], ttArray[this.id]. dArray[this.id], linkArray[this.id]);
disButtons2(this.id);
}
btw you can use
tags so your code will be more readable, I've done it for you this time;)
scotty(-:
ryanflair
August 31st, 2006, 06:57 PM
holy **** man that was it :) :) :) wow, yeah it was a typo in my code, but that was it, thanks man its working now :)
milesdavis
September 8th, 2006, 03:55 AM
Hello,
I'd like to fix the next/last buttons in this code so they loop continuously, right now they stop at the first and last images, it would be great if they looped through everything. Can anyone see where I can fix this? Thanks below is the AS, thanks to Scotty for the script.
-md
var tnNr;
spacing = 10;
container._alpha = 0;
var curLength, cur = 0;
MovieClip.prototype.loadPic = function(id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pArray[id]);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
info._y = Math.round(this._y+this._height/2+spacing/2);
container._alpha += 5;
if (container._alpha>90) {
info.text = iArray[id];
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
var galLength;
my_xml = new XML();
my_obj = new Object();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
var galleries = this.firstChild.childNodes;
galLength = galleries.length;
for (var i = 0; i<galLength; i++) {
my_obj[i] = new Object();
my_obj[i].nodes = galleries[i].childNodes;
var gal_btn = nav_gal.attachMovie("gal_btn", "gal_btn"+i, i);
gal_btn._y = i*20;
gal_btn.label.text = galleries[i].attributes.name;
gal_btn.label.autoSize = true;
gal_btn.bg._width = gal_btn.label._width;
gal_btn.id = i;
gal_btn.onRelease = function() {
galleryChoice(this.id);
disButtons(this.id);
};
}
}
galleryChoice(0);
disButtons(0);
};
my_xml.load("gallery.xml");
function galleryChoice(q) {
tArray = [];
pArray = [];
iArray = [];
cur = 0;
for (var j = 0; j<curLength; j++) {
scroll.th_nav["thmb"+j].removeMovieClip();
}
gallery = my_obj[q].nodes;
curLength = gallery.length;
for (var i = 0; i<gallery.length; i++) {
pArray.push(gallery[i].attributes.source);
tArray.push(gallery[i].attributes.thumb);
iArray.push(gallery[i].attributes.title);
}
delay = setInterval(makeButtons, 50);
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = scroll.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%3*50;
thb._y = Math.floor(i/3)*75;
}
loadButtons();
}
function loadButtons() {
var tbox = scroll.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
for (var i = 0; i<pArray.length; i++) {
var but = scroll.th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(this.id);
disButtons2(this.id);
cur = this.id;
};
}
container.loadPic(0);
disButtons2(0);
}
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
scroll.th_nav["thmb"+i].enabled = 1;
scroll.th_nav["thmb"+i].box._alpha = 100;
} else {
scroll.th_nav["thmb"+i].enabled = 0;
scroll.th_nav["thmb"+i].box._alpha = 50;
}
}
}
function disButtons(d) {
for (var i = 0; i<galLength; i++) {
var but = nav_gal["gal_btn"+i];
if (i != d) {
but.enabled = 1;
but.gotoAndStop(1);
} else {
but.enabled = 0;
but.gotoAndStop(2);
}
}
}
prev_btn.onRelease = function() {
cur>0 ? (cur--, container.loadPic(cur), disButtons2(cur)) : null;
};
next_btn.onRelease = function() {
cur<curLength-1 ? (cur++, container.loadPic(cur), disButtons2(cur)) : null;
};
scotty
September 8th, 2006, 06:49 PM
prev_btn.onRelease = function() {
cur>0 ? cur-- : cur=curLength-1;
container.loadPic(cur);
disButtons2(cur);
};
next_btn.onRelease = function() {
cur<curLength-1 ? cur++ : cur=0;
container.loadPic(cur);
disButtons2(cur);
};
scotty(-:
milesdavis
September 9th, 2006, 03:09 AM
Scotty = God!
thanks again!!
-md
williby27
September 10th, 2006, 06:26 AM
Well i'm having trouble with scotty's gallery.
I've made the thumbnails line up in a row and have the th_nav mc inside a movie clip called navMask which then creates the scroller.
You can view my gallery here (http://www.wjrdesign.com/nathan/gallery3.swf).
something isnt going write then a picture link is clicked.
The loadPic function isnt getting called and thats my problem.
heere is my code:
var tnNr;
spacing = 10;
container._alpha = 0;
var curLength;
MovieClip.prototype.loadPic = function(pic, id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
info._y = Math.round(this._y+this._height/2+spacing/2);
container._alpha += 5;
if (container._alpha>90) {
info.text = id;
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
function galleryChoice(q) {
pArray = new Array();
tArray = new Array();
iArray = new Array();
my_xml = new XML();
for (var j = 0; j<curLength; j++) {
this.navMask.th_nav["thmb"+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes[i].attributes.source);
tArray.push(gallery.childNodes[i].attributes.thumb);
iArray.push(gallery.childNodes[i].attributes.title);
}
}
delay = setInterval(makeButtons, 50);
};
my_xml.load("gallery.xml");
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = navMask.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i*70;
}
loadButtons();
}
function loadButtons() {
var tbox = navMask.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = navMask.th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id]);
disButtons2(this.id);
};
}
container.loadPic(pArray[0], iArray[0]);
disButtons2(0);
}
butArray = new Array();
butArray = ["gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn"];
function mainButtons() {
for (var i = 0; i<butArray.length; i++) {
this[butArray[i]].id = i;
this[butArray[i]].onRelease = function() {
galleryChoice(this.id);
disButtons(this.id);
};
}
}
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
this.navMask.th_nav["thmb"+i].enabled = 1;
this.navMask.th_nav["thmb"+i].box._alpha = 100;
} else {
this.navMask.th_nav["thmb"+i].enabled = 0;
this.navMask.th_nav["thmb"+i].box._alpha = 50;
}
}
}
function disButtons(d) {
for (var i = 0; i<butArray.length; i++) {
if (i != d) {
this[butArray[i]].enabled = 1;
this[butArray[i]].gotoAndStop(1);
} else {
this[butArray[i]].enabled = 0;
this[butArray[i]].gotoAndStop(2);
}
}
}
disButtons(0);
galleryChoice(0);
scotty
September 11th, 2006, 04:13 PM
@ ryanflair & milesdavis: no problem :thumb:
@williby27: for me all thumbs are working in your link?
scotty(-:
williby27
September 11th, 2006, 10:23 PM
hmm thanks scotty i just realised it works in my internet explorer but not firefox - weird. I have firefox 1.5.0.6
milesdavis
September 16th, 2006, 04:56 AM
hey scotty,
what about adding 'image numbers' to this gallery (see post #1013 for the AS). So, you could have the next last and also have say "image 1/10" or even just a number?
Is that possible?
Thanks man! - md
koenmeloen
October 26th, 2006, 10:55 AM
Hi, I'm looking for an imagegallery like the one under images on
www.fiscusphoto.com
v3_thumbs is almost alike. Is there a tut how to do this or is there someone who knows how to do this?
shanna
November 27th, 2006, 10:48 PM
I didn't want to start another xml gallery thread. So I think what I am saying/looking for falls under this topic. I found this http://www.marisoltamez.com/gallery/ and I was wondering instead of having the image start from mtop to bottom. Can it be resized to fit in the movie clip.
scotty
December 1st, 2006, 10:02 AM
I don't understand your question if I look at the example you gave?
scotty(-:
plonker
December 4th, 2006, 02:51 AM
Hello Scotty,
If you wanted to display the thumbnails in a single row with thumbnails of varying widths could you? If so, how would this be done? I can't even pretend to know where to start and have tried to make it work in my own way but sometimes ya just gotta ask for help.
Thanks Scotty.
scotty
December 4th, 2006, 04:40 AM
Remove the code for the x and y position in the makeButtons function, then change the loadButtons function like below
function loadButtons() {
var tbox = th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (tbox._width) {
//if tnNr isn't false, so if it isn't the first thumb
if (!tnNr) {
//set the xposition to the previous thumbs xposition plus it's width
//maybe you want to add some spacing here as well
th_nav["thmb"+tnNr]._x = th_nav["thmb"+(tnNr-1)]._x+th_nav["thmb"+(tnNr-1)]._width;
}
nextButton();
delete this.onEnterFrame;
}
};
}
Not tested...
scotty(-:
plonker
December 7th, 2006, 03:02 AM
Heya Scotty,
That was fast. I actually forgot to subscribe tot the thread...took me a bit to find your reply. I tried something similar to this by trying to mimick portions of the "container" resizing code. I had a hunch but not enough knowlege. i will try this out and let you know what happens. Thanks...really!
Neil
plonker
December 7th, 2006, 03:38 AM
Hello Scotty,
So I tried it out, removed position code and fixed one line of code which was missing "scrolled". So now both functions look like this:
Neil
ActionScript Code:
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = scrolled.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
}
loadButtons();
}
function loadButtons() {
var tbox = scrolled.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (tbox._width) {
trace (tbox._width);
//if tnNr isn't false, so if it isn't the first thumb
if (!tnNr) {
//set the xposition to the previous thumbs xposition plus it's width
//maybe you want to add some spacing here as well
th_nav["thmb"+tnNr]._x = th_nav["thmb"+(tnNr-1)]._x+th_nav["thmb"+(tnNr-1)]._width;
}
nextButton();
delete this.onEnterFrame;
}
};
}
What it does is traces back all the correct widths but does not space them out at all. I will try some other stuff later but if you see what the probelm may be of course feel free to let me know. Thanks again Scotty!
plonker
December 12th, 2006, 02:03 AM
Hello Scotty,
Basically, I can't make this work. I will try and find another way to load the gallery thumbs.
Thanks dude!
Neil
scotty
December 12th, 2006, 03:11 AM
Can you post your fla plus a few thumbs?
scotty(-:
michey
December 12th, 2006, 05:19 AM
Hi Scotty
First, big thanks to you and to all involved in this thread for your beautyful and useful work.
If you ever have the time, could you think a little bit about a solution for a version of the gallery, which works with two containers?
I worked successfully with the different versions which I adapted for my needs (see the gallery in my link -my.new.one- ) and I would like to go a litte step further experimenting with mx transitions, easings and masking.
For that I think it would be necessary to have two containers, which could be set to different _alpha values, so they can crossfade each others and at the same time do different mx transitions like Blinds, Wipe or whatever.
There is no need to have resizing and thumbnails, because I would work with pictures all having the same size.
I know there is a SlideShow which works with crossfading, but first:I didn't came up to build a function to call single pictures with a button for every picture, and second I am very familiar now with the code of the resizing Gallery, so I can do a lot of adjustment by myself.
But with this two containers thing I'm stacked.:a:
Any starting point would be highly appreciated.:ne:
iloveny
December 12th, 2006, 11:15 AM
Hi Scott and everyone else!
Wow, I see this thread has gone crazy!!!!
Just a suggestion, maybe you can create sort of tutorial for resizing things. You know, the tutorial page like on Kirupa.com. They have many tutorials right and they categorize it under XML, 3D animation, Animation, and many more. Maybe you create one like that and put it under certain category.
THanks!
plonker
December 13th, 2006, 01:53 AM
Hello Scotty,
I tried some stuff today trying to use the info I could obtain via "trace" but no luck. I need to hit the books on this stuff a bit harder I think. Thanks for having a look again. You are a good person.
Thanks Dude!
Neil
Can you post your fla plus a few thumbs?
scotty(-:
plonker
December 13th, 2006, 02:02 AM
forgot the fla sorry :P
Hello Scotty,
I tried some stuff today trying to use the info I could obtain via "trace" but no luck. I need to hit the books on this stuff a bit harder I think. Thanks for having a look again. You are a good person.
Thanks Dude!
Neil
scotty
December 16th, 2006, 07:42 AM
@ michey: the idea is right to do it with 2 containers, you can use a toggle function so you load the picture into the right container.
However because you want to stick to this code and we have a prototype here it's easier to duplicate a new mc everytime the function is called. Something like this may do the trick, it's not tested...
var c = 0, con, oldCon;
MovieClip.prototype.loadPic = function(id) {
info.text = "";
con = this.duplicateMovieClip("cont"+c, this.getNextHighestDepth());
oldCon = this._parent["cont"+(c-1)];
c++;
con._alpha = 0;
con.loadMovie(pArray[id]);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
//I left these if you want to have a preloader
var t = con.getBytesTotal(), l = con.getBytesLoaded();
if (con._width) {
doTransition(id);
delete this.onEnterFrame;
}
};
};
function doTransition(id) {
//here you can do the transition, con is the new picture
//oldCon the old one
//for con the alpha is set to 0
//and id is the numbe which you can use for eg a title array
}
scotty(-:
scotty
December 16th, 2006, 08:15 AM
@plonker: there were some errors in the code (my bad:trout: ).
One thing if you replace the code is the outline that's in the thumb mc, it will not resize. Let me know if you want this or that you're not gonna use it.
replace the loadButtons function and put this one in:
function loadButtons() {
var tbox = scrolled.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (tbox._width) {
if (tnNr) {
scrolled.th_nav["thmb"+tnNr]._x = scrolled.th_nav["thmb"+(tnNr-1)]._x+scrolled.th_nav["thmb"+(tnNr-1)]._width;
}
nextButton();
delete this.onEnterFrame;
}
};
}
scotty(-:
michey
December 16th, 2006, 08:18 AM
@scotty
Oh captain, my captain...
you saved me!
Thanks a lot for helping me out of this hole.
Now I have something to play around with, so let's go...
And in the case I will be stacked again, I know where to ask!
Have a nice weekend!
:?)
scotty
December 16th, 2006, 02:33 PM
welcome, have a great weekend too!
scotty(-:
plonker
December 17th, 2006, 03:01 PM
Scotty! This is great. I don't rthink I will use the outline anyways so no worries there. Thanks again Scotty!
Neil
@plonker: there were some errors in the code (my bad:trout: ).
One thing if you replace the code is the outline that's in the thumb mc, it will not resize. Let me know if you want this or that you're not gonna use it.
replace the loadButtons function and put this one in:
ActionScript Code:
function loadButtons() {
var tbox = scrolled.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (tbox._width) {
if (tnNr) {
scrolled.th_nav["thmb"+tnNr]._x = scrolled.th_nav["thmb"+(tnNr-1)]._x+scrolled.th_nav["thmb"+(tnNr-1)]._width;
}
nextButton();
delete this.onEnterFrame;
}
};
}
scotty(-:
michey
December 18th, 2006, 04:14 AM
Hi Scotty
I'm sorry, but I have to ask for help again.
That's "my" code
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes[i].attributes.title);
pArray.push(gallery.childNodes[i].attributes.source);
}
con.loadPic(0);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("gallery.xml");
//--------------------------------
var pArray = new Array();
var tArray = new Array();
var c = 0, con, oldCon;
MovieClip.prototype.loadPic = function(id) {
info.text = "";
con = this.duplicateMovieClip("cont"+c, this.getNextHighestDepth());
oldCon = this._parent["cont"+(c-1)];
c++;
con._alpha = 0;
con.loadMovie(pArray[id]);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = con.getBytesTotal(), l = con.getBytesLoaded();
if (con._width) {
doTransition(id);
delete this.onEnterFrame;
}
};
};
//-------------------------------
import mx.transitions.*;
//-------------------------------
function doTransition(id) {
con._alpha = 100;
var transType:Transition = Photo;
var myTM:TransitionManager = new TransitionManager(con);
myTM.startTransition({type:transType, direction:0, duration:2, shape:empty, startPoint:5, xSections:empty, ySections:empty, dimension:0, easing:easing.Elastic.easeOut, shape:empty});
function transOut() {
if (con.getBytesTotal()>20) {
var myListener:Object = new Object();
myListener.allTransitionsOutDone = function() {
loadPic();
};
var transType:Transition = Wipe;
var myTM:TransitionManager = new TransitionManager(oldCon);
myTM.addEventListener("allTransitionsOutDone", myListener);
myTM.startTransition({type:transType, direction:1, duration:0.5, shape:empty, startPoint:5, xSections:empty, ySections:empty, dimension:0, easing:easing.Strong.easeOut, shape:empty});
} else {
loadPic();
}
}
}
//--------------------------
this.prevb.onRelease = function() {
if (c == 0) {
con.loadPic(pArray.length-1);
} else {
con.loadPic(c-1);
}
};
this.nextb.onRelease = function() {
if (c == pArray.length-1) {
con.loadPic(0);
} else {
con.loadPic(c+1);
}
};
but only the first picture with the first transition is loaded, then nothing more is going on.
My goal is to have a "doTransition"-function, which has inside one transition for the old picture out and one for the new picture in.
I'm sure I'm doing something wrong, but I really don't know what.
--here is my .fla-- (http://ceram-mic.com/.flas/MXTRANS_TEST.zip)
turnquist
December 18th, 2006, 10:28 AM
how can i change the multiple gallery to use the first frame as a gallery selection instead of automatically loading the first gallery
scotty
December 18th, 2006, 12:24 PM
@plonker: you're welcome:thumb:
@turnquist: at the bottom of the code skip
galleryChoice(0);
@michey: I'm not that familiar with that Transitions class, but I'll have a look later
scotty(-:
michey
December 18th, 2006, 12:50 PM
-Here some Infos about the Transition Manager Class- (http://www.onebyonedesign.com/tutorials/transMgr/scriptTrans.html)
turnquist
December 19th, 2006, 03:46 AM
thanks scotty
you're ridiculously generous with your help
scotty
December 19th, 2006, 04:43 AM
no problem:pleased:
turnquist
December 19th, 2006, 07:38 AM
also is it more efficient to just use setIntervall to wait for the border to finish drawing or use an onEnterFrame/IsTweening check?
irrimiri
December 23rd, 2006, 05:42 PM
Hi there (again within a two days), lol.
I have used this resize zip and have followed this looong thread until page 18 but gave up because it's so much to read into, lol. I think I did quite well, but am not sure if anybody else had this problem before.
The files are great and I have been creating the photogallery for a secret project for my little sis' company. (she is a goldsmith, tells the proud big Sister:beam: )
The gallery works fine, but when the images are not in cache yet, the image will appear on the right side of the 'frame' at first, instead of the middle. After clicking that button again it will appear where it belongs though, like nothing happened. This only happens when the files are uploaded to the internet.
Here you can see the site in it's beta version:
http://www.miriambos.com/test/sterling/
The site is in dutch, but if you click on the word 'ringen' (which means rings) (or the other words below) you see thumbnails appear with numbers in it. When you click those the images will appear. But you can see them jumping. Really Odd
I tried to look into the code, but of course without any result.
I have a zip for whom is interested to have a look at it.
The code is from this (really amazing) thread.
http://www.miriambos.com/test/sterling/menu-sieraden-test.zip
Thanks very much in advance!!
greetings from Miriam
stringy
December 24th, 2006, 05:53 AM
Hi there (again within a two days), lol.
I have used this resize zip and have followed this looong thread until page 18 but gave up because it's so much to read into, lol. I think I did quite well, but am not sure if anybody else had this problem before.
The files are great and I have been creating the photogallery for a secret project for my little sis' company. (she is a goldsmith, tells the proud big Sister:beam: )
The gallery works fine, but when the images are not in cache yet, the image will appear on the right side of the 'frame' at first, instead of the middle. After clicking that button again it will appear where it belongs though, like nothing happened. This only happens when the files are uploaded to the internet.
Here you can see the site in it's beta version:
http://www.miriambos.com/test/sterling/
The site is in dutch, but if you click on the word 'ringen' (which means rings) (or the other words below) you see thumbnails appear with numbers in it. When you click those the images will appear. But you can see them jumping. Really Odd
I tried to look into the code, but of course without any result.
I have a zip for whom is interested to have a look at it.
The code is from this (really amazing) thread.
http://www.miriambos.com/test/sterling/menu-sieraden-test.zip
Thanks very much in advance!!
greetings from Miriam
try changing to
spacing = 10;
MovieClip.prototype.loadPic = function(pic) {
this._alpha = 0;
this._x = -2000;
this.loadMovie(pic);
_root.createEmptyMovieClip("boo",11000)
boo.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
this.removeMovieClip()
}
};
};
other function as it is
you only need this on the first frame -delete the other frames in the actionscript layer
scotty
December 24th, 2006, 06:15 AM
@turnquist: in this case (just the border) I don't think an onenterframe will need more resources as a setInterval...
@irrimiri:
hoi Miriam, altijd leuk om een Nederlander tegen te komen op kirupa!
In the loadPic change this line:
if (t != 0 && Math.round(l/t) == 1){
with
if (containerMC._width){
and I think your problems are gone=)
scotty(-:
irrimiri
December 25th, 2006, 03:50 AM
@thanks Stringy!!
This is a very useful code! Thanks so much. I am going to try that out too. For now I saw Scotty's code first so I tried that out first. But this should save me a lot of frames/coding. It's great. *going to try it out too!*
@Scotty
Hoi, ik dacht echt dat je gewoon Schots of zoiets zou zijn hahaha. Dat is echt humor!!
Also, thanks so much for your code. I tried that out too and it works very good too.
Both solutions are great, so now I need to choose, haha. Ow such luxury .:thumb2:
Thanks guys, you really make my day, (since this website is going to be my sister's Christmas present, so I need to hurry up, hihi)
Greetings from Miriam
AND HAPPY HOLIDAYS!!
irrimiri
December 25th, 2006, 03:55 AM
Owww
@stringy.
I bet I need to change the code to the buttons too for your solution.
Now they are a simple
on (release){
gotoAndStop("ringen");
}
stringy
December 25th, 2006, 04:59 AM
Owww
@stringy.
I bet I need to change the code to the buttons too for your solution.
Now they are a simple
on (release){
gotoAndStop("ringen");
}
If you mean with all code on 1 frame - then no changes required.
I`ve changed this to include Scottys suggestion but i do think it unwise to use "_root.onEnterFrame" when you are using the main timeline to navigate.
http://www.fmx6.com/menu-sieraden-testaa.zip
scotty
December 25th, 2006, 05:29 AM
@stringy: you're right on the _root.onEnterFrame, LOL, it's my coding from 2004 I believe... I've learned a lot since then:lol:
For the misplacement I believe it's in the if statement, it's better to check for the width (or height) as you will know off course;)
scotty(-:
stringy
December 25th, 2006, 05:53 AM
@stringy: you're right on the _root.onEnterFrame, LOL, it's my coding from 2004 I believe... I've learned a lot since then:lol:
For the misplacement I believe it's in the if statement, it's better to check for the width (or height) as you will know off course;)
scotty(-:
I was actually thinking irrimiri had modified one of your files to use the timeline.
yeh i think most of us older "flashers" :blush: use this method rather than MCL.
Anyway i don`t think i`ll post in this thread much in the future, looks like a full time job.
scotty
December 25th, 2006, 06:07 AM
Sometimes it feels like a full time job, certainly in the beginning, I guess you know that feeling with all your (awesome) galleries in S & E.
Just know tat your contibutions to this thread are more then welcome;)
scotty(-:
irrimiri
December 27th, 2006, 07:10 PM
Wow, finally time to reply. And I see you guys had some chat, haha.
Bit busy with the xmas days.
I am not sure if I 'get' what stringy meant with his comment after my last question, but I am going to try it out.
Thanks for replying to the question again. Even during xmas, lol. I tell enough how much I appreciate it.
I finished the website of my sis btw, using the adjusted flash gallery from Scotty in it's portfolio and it works very good. And my sis was very happy with her xmas present, so you guys saved the day. http://www.sterlingmemories.nl if you are interested ;)
Hope you had some great holidays!
greetings from irrimiri ^_____^
scotty
December 29th, 2006, 10:33 AM
Looks nice! Maybe you have to look into the font in the gallery, I get a black Times over here, I think (if this wasn't the font you intended to have here) you need to embed the font there. Same for the copyright thingy at the bottom...
scotty(-:
irrimiri
December 30th, 2006, 01:23 PM
Thanks very much :D
the font in the gallery? Ehm I used Script MT bold and Times new roman there.
But what do you mean with embed? Like nesting? Not sure how to do that, unless you just mean I should make the copyrights for example part of the swf of course.
plonker
January 1st, 2007, 11:29 PM
Hello darylws,
Not sure if you are still watching this thread, but here goes. This dynamic menu system is pretty cool, thanks for doing that. I have been mucking with this gallery for quite some time and Scotty has graciously helped me out with some mods to this prior to adding in the dynamic menu bits. I cannot for the life of me figure out why I get the titles and subtitles as undefined. I have gone over the code I "hacked" in and the xml and can't seem to fill the hole. Can you have a look at this. I have included the fla and xml I am working with.
On a side note, the menu disappears when trying to load as an external swf. Any thoughts there?
Thanks a bunches!
Neil
Cheers Nosmo!
Here's the code and XML without the pictures - It could do with a bit of tidying up as the XML is loaded in the second scene (where the array is created for the dynamic gallery buttons) then again in the main movie - if I get a chance to work on it some more I'll post it again but in the meantime.......
Amendments:
- Added Movie preloader in Scene1
- Added XML loader in Scene 2 to create Dynamic Gallery buttons
- Altered XML to incorporate Gallery title attributes
- Changed the thumbnail alignment (now vertical)
- Added vertical scroll buttons for thumbnails (still needs some work)
- Added image preloader
- Added Highlight state for first gallery
- Added titles to thumbnails (relevant to this project)
Here's the link (http://www.south-milford.co.uk/events/index.htm) again to the finished gallery.
Cheers!
Daryl
plonker
January 2nd, 2007, 01:18 AM
This turns out to be a Version issue. Published as flash 6.0 and works fine....almost.
Anyone want to update this to AS 2.0...for whatever reason?
Neil
p.s. I still can't get it to load properly as an external swf...anyone help me with that?
whoever
January 5th, 2007, 12:25 PM
hi there, wow, this slideshow is great! however, i still have one question that hasn't been answered yet (or maybe i was just too blind to find...):
is it possible to have the thumbnails and the main pictures in _one_ folder?
example: pic1.jpg and thb_pic1.jpg - i tried and tried but i couldn't find any solution...
what would i have to change if possible?
cheers, who
plonker
January 5th, 2007, 01:16 PM
I can't see why not, the path in the xml would have to reflect the location of course. Give it a whirl.
Neil
hi there, wow, this slideshow is great! however, i still have one question that hasn't been answered yet (or maybe i was just too blind to find...):
is it possible to have the thumbnails and the main pictures in _one_ folder?
example: pic1.jpg and thb_pic1.jpg - i tried and tried but i couldn't find any solution...
what would i have to change if possible?
cheers, who
mattjp18
January 14th, 2007, 12:49 PM
Can you help me modify the gallery to get the effect like on iso50.com, with the fading grid buttons and the thumbnail appears in the corner. I want to do something like this. thanks. Matt
Uzi
January 20th, 2007, 11:02 AM
I downloaded the source file for Scotty's V3_with_thumbs and would like to know how to add another dynamic text box to it.
I've tried and copied the arrangement and placement of iArray (calling it dArray), added dArray.push(gallery.childNodes[i].attributes.descrip); (with descrip being my new entry in the XML file). Given an instance name etc... but if I call descripTxt.text = id; (descripText being the instance name of the text box) I get the same Text given by the existing info/title text.
dArray traces with the correct content (but all of it).
Can someone help me with adding in another dynamic text box please?
SmoothAssault
January 20th, 2007, 10:49 PM
Wow, I spent the last two days reading this thread on and off. Fantastic! I have messed around with V2 and got a layout I'm happy with and it is almost functioning properly too. But I am still having some problems.
I am using the gallery as part of my mySpace page (sad I know, but I have actually quite enjoyed seeing exactly how much you can customise the pages) I have a main .swf that uses loadmovie to open up the gallery .swf, to which I have added a simple preloader. What I have so far can be viewed here http://www.myspace.com/smoothassault. Clicking 'picture gallery' will open up the gallery.
The problems I am having are ghosting (I know many replies have been posted of how to fix this problem, but all the ones I have tried just seem to make the whole gallery stop working).
The second problem is that the border does not always scale correctly, and the images are sometimes not in the right place. You will see exactly what I am talking about if you check out my page.
I have noticed that if you click on a thumb and the image doesn't appear correctly, clicking the same thumb again (or in some cases clicking it a third time) will make it work? It seems very strange to me.
Could someone please take a look at my files and see what's going wrong? I will attach a .zip with the .fla and .xml files.
Once these little problems are fixed I will put in the preloader for the images. Then probably get stuck, and ask for some help with that :P
Thanks,
Matt.
Hunson
February 2nd, 2007, 12:55 AM
this thread is good...
SmoothAssault
February 7th, 2007, 09:19 PM
Wow, 19 people downloaded my file so far, yet no one can help me out? It's not that big of a problem is it?.. Although saying that, I'm still stumped :h:
bilge17
February 8th, 2007, 11:14 AM
I can load unlimited images locally on my server, work GREAT!!! Thanks again for the FLA.
Now i am hosted on a small server and would like my images to be loaded by a URL to a site like Photobucket, filelodge, etc... FREE STORAGE and BANDWIDTH!
I place the URL in nested image location #4 in Gallery 3, all irrelevant since i have tried in all galleries and all image nodes. Anyways, when viewed i can 'next_btn" through all the images until i get to that URL one. The wierd part is that the image loads correctly and resizes, but it shuts down the SWF or something. I can't click previous, next, galleries, anything. have to refresh to navigate around that image.
HELP!!!!! PLEASE!!!!!!:wasted:;)
Check for yourself if anyone wants to see it in action.
<http://home.comcast.net/~bilge17/resizeBorder_multi.html>
Eric the Pixie
February 18th, 2007, 02:17 PM
Hi there - topper of a thread, great input from all concerned.
I've waded throught the first 30 pages and learned how to code your nifty gallery.
Everything went like clockwork, until last week. I have been pulling my hair out trying to get the first image to appear automatically when the gallery first runs.
No matter what I did, I ended up with the border movie in a small rectangle in the centre of the screen and the container movie image was wrongly positioned.
However, if I clicked a button and triggeried the loadpic routine via an on(release) after this initial load, it worked perfectly with the image and the border in the proper place.
It took me a week of frustration before I discovered the publish settings in Flash 8 pro were set for the V7 player. I changed this to V6 and the damn thing worked perfectly.
So, just in case anyone else has had this problem - thats how it can be fixed.
I apollogise in advance if this snippet of wisdom has already been posted (as I mentioned, I only read up to the 30th page).
Once again, great work guys :}
BadBadNeil
March 6th, 2007, 09:56 PM
I posted a while back about Firefox and IE displaying flash preloaders differently and never found a solution.
Today while browsing the best of I noticed this link posted by Scotty in the finished xml galleries thread stickied at the top and tested in IE and FF. The preloader also doesn't work in my FF 2.0.0.2 but works fine in IE 6.5. I have the latest flash plugins.
Here is the link I am referring to http://www.jeffwinder.nl/resize/resizeBorder_V3_lacotweens.html
Does anyone else using FF 2 notice it as well? The preloader in FF just goes to 100% in the bar while the IE version actually shows the progression of the bar. I unloaded the cache and no effect in FF.
jasmine
March 13th, 2007, 04:05 AM
hello, i really really need help with this. this is probably really easy for a.s. geniuses, but i'm really bad. i have look at the actionscript for hours and can not figure it out, i have been searching and searching and can't find anything on the forum...
i working with scotty's gallery with thumbnails
V3_with_thumbs
the original set up has the thumbnail sized at 40 x 40 pixels, i'm trying to enlarge it to 60 x 60 pixels. i enlarge the thumbnail box in flash, but it messes up the thumbnails in swf files (if i have a thumb sized at 60x60 - the flash file enlarges it - it doesn't actually fit in the 60x60 box). this is probably hard to understand, so view it here to see what i mean.
http://homepage.mac.com/van13/Sites/v3_thumbs_problem/thumbs_problem.html (http://homepage.mac.com/van13/Sites/v3_thumbs_problem/thumbs_problem.html)
see thumb #1 - the white box in the flash file is 60x60, but when i try to load a 60x60 thumb photo - it enlarges it.
i have also attached the source file. please please help if you can! thanks!!!
stringy
March 13th, 2007, 02:37 PM
hello, i really really need help with this. this is probably really easy for a.s. geniuses, but i'm really bad. i have look at the actionscript for hours and can not figure it out, i have been searching and searching and can't find anything on the forum...
i working with scotty's gallery with thumbnails
V3_with_thumbs
the original set up has the thumbnail sized at 40 x 40 pixels, i'm trying to enlarge it to 60 x 60 pixels. i enlarge the thumbnail box in flash, but it messes up the thumbnails in swf files (if i have a thumb sized at 60x60 - the flash file enlarges it - it doesn't actually fit in the 60x60 box). this is probably hard to understand, so view it here to see what i mean.
http://homepage.mac.com/van13/Sites/v3_thumbs_problem/thumbs_problem.html (http://homepage.mac.com/van13/Sites/v3_thumbs_problem/thumbs_problem.html)
see thumb #1 - the white box in the flash file is 60x60, but when i try to load a 60x60 thumb photo - it enlarges it.
i have also attached the source file. please please help if you can! thanks!!!
You have 2 loadButton functions, delete them both and replace with this
function loadButtons() {
var tbox = scroll.th_nav["thmb"+tnNr].createEmptyMovieClip("b",1)
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
container._alpha = 0;
bar._visible = true;
box._visible = true;
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
var per = Math.round(((bl/bt)*100)/tArray.length);
bar._width = ((totPer+per));
info.text = "Loading Photo "+(tnNr+1)+" of "+tArray.length+"";
if (bt == bl && bt>4) {
tbox._x =28-tbox._width/2
tbox._y =28-tbox._height/2
nextButton();
totPer += per;
delete this.onEnterFrame;
}
};
}
jasmine
March 13th, 2007, 10:04 PM
stringy - you are a life saver! thank you so much! do you accept paypal donations or anything??? i really owe you!
You have 2 loadButton functions, delete them both and replace with this
ActionScript Code:
function loadButtons() {
var tbox = scroll.th_nav["thmb"+tnNr].createEmptyMovieClip("b",1)
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
container._alpha = 0;
bar._visible = true;
box._visible = true;
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
var per = Math.round(((bl/bt)*100)/tArray.length);
bar._width = ((totPer+per));
info.text = "Loading Photo "+(tnNr+1)+" of "+tArray.length+"";
if (bt == bl && bt>4) {
tbox._x =28-tbox._width/2
tbox._y =28-tbox._height/2
nextButton();
totPer += per;
delete this.onEnterFrame;
}
};
}
stringy
March 14th, 2007, 02:44 AM
stringy - you are a life saver! thank you so much! do you accept paypal donations or anything??? i really owe you!
No problem
I do but not for this ;)
ALGORYTHM
March 20th, 2007, 03:26 PM
You have 2 loadButton functions, delete them both and replace with this
function loadButtons() {
var tbox = scroll.th_nav["thmb"+tnNr].createEmptyMovieClip("b",1)
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
container._alpha = 0;
bar._visible = true;
box._visible = true;
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
var per = Math.round(((bl/bt)*100)/tArray.length);
bar._width = ((totPer+per));
info.text = "Loading Photo "+(tnNr+1)+" of "+tArray.length+"";
if (bt == bl && bt>4) {
tbox._x =28-tbox._width/2
tbox._y =28-tbox._height/2
nextButton();
totPer += per;
delete this.onEnterFrame;
}
};
} hi stringy, i was wondering if you could explain the code for using thumbnails that are not 40x40px and where theMask is also not the standard size.
well really, i'd just like you tell me how i can use 100px square thumbnails and a 400px square mask ;)
but if you want to explain it to me so i can work it out myself that would be good too :D
thanks in advance.
stringy
March 20th, 2007, 06:08 PM
hi stringy, i was wondering if you could explain the code for using thumbnails that are not 40x40px and where theMask is also not the standard size.
well really, i'd just like you tell me how i can use 100px square thumbnails and a 400px square mask ;)
but if you want to explain it to me so i can work it out myself that would be good too :D
thanks in advance.
Which one of Scottys files are you working with? If you can give me a link to file?
ALGORYTHM
March 21st, 2007, 07:33 AM
Which one of Scottys files are you working with? If you can give me a link to file? oops. i am actually using the same files as jasmine. here are some links
http://algorythm.co.uk/design/gallery/gallery.html
http://algorythm.co.uk/design/gallery/gallery.zip
http://algorythm.co.uk/design/index.php?path=gallery/
based on: v3 thumbs scrolled i believe.
tia
stringy
March 21st, 2007, 10:56 AM
oops. i am actually using the same files as jasmine. here are some links
http://algorythm.co.uk/design/gallery/gallery.html
http://algorythm.co.uk/design/gallery/gallery.zip
http://algorythm.co.uk/design/index.php?path=gallery/
based on: v3 thumbs scrolled i believe.
tia
see if this helps
I`ve just duplicated the xml to show scrolling - use with original pics in folder
ALGORYTHM
March 21st, 2007, 11:12 AM
see if this helps
I`ve just duplicated the xml to show scrolling - use with original pics in folder that is superb :D
i see you've made quite a few changes, i'll have a good nose around now ;)
stringy
March 21st, 2007, 11:28 AM
that is superb :D
i see you've made quite a few changes, i'll have a good nose around now ;)
Glad it`s ok
Yes i had to change all the scrolling stuff
hei
March 31st, 2007, 04:50 PM
hi there, thanks for sharing this great gallery. I have been trying to build one too, i am combining this gallery with a slider thumbnail function from another tutorial on this kirupa site. it is kind of working, but there is one problem. the loaded photos are all slightly blurred(well, not perfect). and i have no idea why.
so, can anyone please help me out here??
I am going mad trying to get it right for a week now.
hei
March 31st, 2007, 04:55 PM
sorry, had some problem uploading the zip file.
well here it is.
http://www.heigraphics.com/gallery.zip
hope someone can help me out.
thanks
mnbvcxz
April 2nd, 2007, 05:51 PM
lol im amazed a three year old thread, and its still going strong, must be some sort of a internet record.:geek:
luis cordova
April 9th, 2007, 01:02 AM
Hi,
I'm "another" Flash Rookie and i'm learning a lot with you guys, so first of all i want to say "thanks a bunch" to all of the gurus for all your time.
If i'm allowed i want to give a different use to this gallery, i would like to use as a news list, so in the selector i need to put (besides the thumb) a title and a few phrases of the complete news.
I know i will need a extra field on the xml to allocate the title and another for the "resumed news" text (i can use the info field for the complete news).
but i'm not good with the dinamic created movie clips, so i cannot add the extra fields to the selector.
Could anybody help me?
oh! by the way, i'm using V3_thumbs_scrolled.fla file
:hugegrin:
Luis
The LostOne
mdudlik
April 12th, 2007, 02:46 PM
Hi there - topper of a thread, great input from all concerned.
I've waded throught the first 30 pages and learned how to code your nifty gallery.
Everything went like clockwork, until last week. I have been pulling my hair out trying to get the first image to appear automatically when the gallery first runs.
No matter what I did, I ended up with the border movie in a small rectangle in the centre of the screen and the container movie image was wrongly positioned.
However, if I clicked a button and triggeried the loadpic routine via an on(release) after this initial load, it worked perfectly with the image and the border in the proper place.
It took me a week of frustration before I discovered the publish settings in Flash 8 pro were set for the V7 player. I changed this to V6 and the damn thing worked perfectly.
So, just in case anyone else has had this problem - thats how it can be fixed.
I apollogise in advance if this snippet of wisdom has already been posted (as I mentioned, I only read up to the 30th page).
Once again, great work guys :}
I am having the same problem, however, saving to flash 6 makes my text look TERRIBLE.
Is there another solution to this at all? I can't seem to find it in the thread, maybe I'm missing the post.
My problem is that I need to click a thumbnail twice in order for the border to resize along w/ the image. The first time it just loads the image and has a small border in the upper corner of the image.
Any help would be great, or a link to where this has been solved already too.
Thanks
stringy
April 12th, 2007, 03:20 PM
I am having the same problem, however, saving to flash 6 makes my text look TERRIBLE.
Is there another solution to this at all? I can't seem to find it in the thread, maybe I'm missing the post.
My problem is that I need to click a thumbnail twice in order for the border to resize along w/ the image. The first time it just loads the image and has a small border in the upper corner of the image.
Any help would be great, or a link to where this has been solved already too.
Thanks
which particular file is it?
I have just tried V3 and it works fine in flash 8
mdudlik
April 12th, 2007, 03:37 PM
which particular file is it?
I have just tried V3 and it works fine in flash 8
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) ==1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
thats my frame text. Its maybe version 1? v3 has xml stuff I didnt want to deal with.
ive noticed its not a problem in Firefox 2.0.3, but it is w/ safari, firefox 1.5 and IE i think.
here is the button code
on(release){
containerMC.loadPic("image1.jpg");
}
So, I've noticed clicking the button twice will have it work just fine. Maybe there is code to do that automatically :). haha.
thanks for any help!
stringy
April 12th, 2007, 04:33 PM
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) ==1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
thats my frame text. Its maybe version 1? v3 has xml stuff I didnt want to deal with.
ive noticed its not a problem in Firefox 2.0.3, but it is w/ safari, firefox 1.5 and IE i think.
here is the button code
on(release){
containerMC.loadPic("image1.jpg");
}
So, I've noticed clicking the button twice will have it work just fine. Maybe there is code to do that automatically :). haha.
thanks for any help!
try
MovieClip.prototype.loadPic = function(pic) {
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function() {
if (containerMC._width) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
};
};
if it fails give me a link to the files
luis cordova
April 12th, 2007, 05:00 PM
Hi,
I'm "another" Flash Rookie and i'm learning a lot with you guys, so first of all i want to say "thanks a bunch" to all of the gurus for all your time.
If i'm allowed i want to give a different use to this gallery, i would like to use as a news list, so in the selector i need to put (besides the thumb) a title and a few phrases of the complete news.
I know i will need a extra field on the xml to allocate the title and another for the "resumed news" text (i can use the info field for the complete news).
but i'm not good with the dinamic created movie clips, so i cannot add the extra fields to the selector.
Could anybody help me?
oh! by the way, i'm using V3_thumbs_scrolled.fla file
:hugegrin:
Luis
The LostOne
Well...
I'm afraid nobody is interested, thanks anyway.
Anyone know any good tute about creating mc dinamically with xml?
Luis
The StillLostOne
mdudlik
April 12th, 2007, 05:09 PM
Thanks so much! IT WORKED
Just for learning purposes, what was the problem?
thanks!
stringy
April 12th, 2007, 05:13 PM
I think if you wanted that to work, you would have to add a condition to check if t & l were not undefined but it is just a better way to check for loading -which i still favour over MCL for pics.
Scotty wrote that code a long time ago.
mdudlik
April 12th, 2007, 11:42 PM
Is there a way to have height spacing differ from width?
the spacing= part at the beginning is the only thing that affects anything it seems.
id like to have the height spacing be more than width, as i've adjusted the border different.
thanks!
stringy
April 13th, 2007, 02:14 AM
Is there a way to have height spacing differ from width?
the spacing= part at the beginning is the only thing that affects anything it seems.
id like to have the height spacing be more than width, as i've adjusted the border different.
thanks!
Not sure i entirely understand but you can have different horizontal/vertical spacing
just define spacingX=whatever & spacingY=whateverelse at the beginning of the script and use
_root.containerMC._x = this._x - this._width/2 + spacingX/2;
_root.containerMC._y = this._y - this._height/2 + spacingY/2;
mdudlik
April 13th, 2007, 01:56 PM
spacing = 20;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function() {
if (containerMC._width) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};that first spacing line controls both height and width. I was hoping to have spacing height be 30 and spacing on width be 20.
The code you put is already in there, towards the bottom, and any adjustments i make to those numbers doesnt seem to affect anything...
mdudlik
April 13th, 2007, 02:01 PM
and just to clarify, im talking about the spacing for the border. right now the border goes 20px more than the image itself. so id like it to go 20 more width, but 30 more height.
stringy
April 13th, 2007, 02:38 PM
and just to clarify, im talking about the spacing for the border. right now the border goes 20px more than the image itself. so id like it to go 20 more width, but 30 more height.
spacingX = 20;
spacingY=30
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
_root.containerMC._alpha = 0;
this.loadMovie(pic);
_root.onEnterFrame = function() {
if (containerMC._width) {
var w = containerMC._width+spacingX, h = containerMC._height+spacingY;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacingX/2;
_root.containerMC._y = this._y - this._height/2 + spacingY/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
mdudlik
April 13th, 2007, 04:29 PM
Thank you, yet again.
you are amazing.
nike121
May 8th, 2007, 04:15 AM
Hey guys, was just curious since we were talking about resizing galleries ....im trying to figure out how to make this ...
http://www.paolosantambrogio.com/
im guessing...he has used a mask to cover the line of pictures underneath....used actionscript to detect and resize the image window....and then on a seperate layer, controls the thumbnails :S...clearly i cant figure this out..
please help !!
newenay
May 10th, 2007, 10:29 AM
Hello,
Well, I think I have just about read this entire awesome thread, and i think it's time for my first posting. My issue has already come up in #926, but I don't think it was ever resolved.
I am having trouble putting the finishing touches on my photo gallery (multiple .xml driven with scrollbar thumbs). Here is a link to two dummied-down versions I am working on. Much of it is a combination of several other tutorials on Kirupa (this site rocks!).
http://www.newenay.com/resize_w_iconScroll.zip (http://www.newenay.com/resize_w_iconScroll.zip)
1.) the first one loads the two .xmls just fine (see slide # text, ie "1 of 2" at bottom), but have a delayed ghosting effect of the picture while it's resizing. May have some preloading issues, I really hav'nt focused on preloading.
2.) the second one's resize works great except for resizing the initial load of the second .xml. Once you click the second picture, the .xml seems to right itself. This one however does'nt seem to know the amount of the .xml array until the second click of either.
Anyway, I am truly perplexed and at a deadend. I have my suspensions that it is "onEnterFrame" related. I have also tried loading multiple .xml with the "v3_wThumbs" version and I get the same issue as with the my second example.
If anyone could help, it would be greatly appreciated.:pirate3:
iloveny
May 11th, 2007, 06:08 PM
Hi!
I am interested in this code. Can anybody help me point out on what thread does the final code can be downloaded? Since this thread is very long, I think there are several versions of the code. What is the final / latest version?
Your help is really appreciated!! Thanks a lot!
jerryj
May 11th, 2007, 06:09 PM
http://www.kirupa.com/forum/showthread.php?t=87388
iloveny
May 12th, 2007, 12:16 PM
hey thanks a lot!
m u r
June 11th, 2007, 02:06 PM
I thought this would be simple, but . . . all I want to do is have the border be an animated movie clip that plays before each image is loaded. Basically, I just want it to grow from a point before the image shows up. I'm using resizeBorder_V3. I'm also interested if there is a version with the thumbs layed out like this but are dynamic? Thanks.
spacing = 10;
containerMC._alpha = 0;
var pArray = new Array();
var tArray = new Array();
var cur = 0;
MovieClip.prototype.loadPic = function(pic) {
cur = pic;
containerMC._alpha = 0;
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (t == l && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
bar._visible = 0;
picinfo.info.text = tArray[pic];
containerMC._alpha = 0;
delete this.onEnterFrame;
} else {
bar._width = per;
picinfo.info.text = per+" % loaded";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
prevb._x = nav._x-5;
nextb._x = nav._x+this._width+5;
nextb._y = prevb._y=this._y-this._height/2;
picinfo._y = nextb._y-5;
picinfo._x = border._x-picinfo._width/2;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
gallery_txt.text = gallery.attributes.info;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes[i].attributes.title);
pArray.push(gallery.childNodes[i].attributes.source);
}
containerMC.loadPic(0);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("gallery.xml");
prevb.onRelease = function() {
cur--;
if (cur<0) {
containerMC.loadPic(pArray.length-1);
} else {
containerMC.loadPic(cur);
}
};
nextb.onRelease = function() {
cur++;
if (cur>pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur);
}
};
codenoobie
June 11th, 2007, 02:48 PM
Hey everyone! I'm new. I've been following everyone's input on this site for awhile now and I just want to say thank you for getting me this far!
I'm using the source file from this thread to create a gallery. I need to click on the images and go to certain urls. I have added a "link" to the XML but don't know how to work it into the ActionScript with this file. Has anyone tried this yet?
codenoobie
June 11th, 2007, 05:32 PM
Ok, after some serious thinking, I figured it out... not sure how... but it worked!
function4
June 20th, 2007, 06:33 PM
Cool! I didn't think this would work because it was written for so many players back, but it seamlessly integrated into my own gallery! I tried to modify it to use the MovieClipLoader class but I couldn't get it working. Anyways, thanks for the code!
boogooloo1
June 29th, 2007, 01:01 AM
Hi guys,
I'm hoping someone will be generous enough to help me with some modifications to the Infinite version of Scotty's gallery, as well as help me fix some bugs! The problem is, I want a combination of all the different versions, and I'm not good enough at AS yet to do it myself :blush:
Firstly, the bug - if you go here (http://www.simonwatson.com.au/sb/sbee.html) and click on gallery you'll see that the infinite thumbnail menu doesn't work like it should - I'm thinking it's because I'm loading it externally? Is it to do with registration point or something?
Secondly the features I'd love to incorporate:
* the description and next/prev buttons from the main version.
* have the infinite thumbnail menu NOT be infinite, meaning when you get to the end of the row of available thumbnails, it stops.
* the main photos being links.
Kirupa's thumbnail gallery has the features I'd like, but doesn't resize, and the thumbnails load strangely.
Would appreciate any help!
:)
stringy
June 29th, 2007, 03:43 AM
for the bug - try removing occurences of "_root" from the thumbNailScroller function
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_ymouse>=thumbnail_mc._y) && (_ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
This may also be useful
http://www.kirupa.com/forum/showthread.php?t=254571
you might also look at the flashlevel thread in this forum as an alternative menu
boogooloo1
June 30th, 2007, 01:40 AM
G'day mate,
Thanks as always for your prompt and helpful reply!!! I'm actually using Scotty's code, so I'm assuming it'd be here:
function activateMenu() {
containerMC.loadPic(2);
menu.onEnterFrame = function() {
var distance = _root._xmouse-center;
if (mask.hitTest(_root._xmouse, _root._ymouse)) {
this._x -= (distance*speed);
if (this._x<-sub_menu._width/2) {
this._x = 0;
}
if (this._x>0) {
this._x = -sub_menu._width/2;
}
}
};
}
I tried removing _root from the 3 spots in there which have it, but the menu won't respond at all to the mouse now. Incidentally (or not), the infinite menu version (http://www.gertdesign.info/kirupa/infinite_resize.zip) of Scotty's gallery is built a tad strangely, with everything in a movie clip rather than on the main timeline - could that be the issue?
:)
stringy
June 30th, 2007, 05:33 AM
its often a good idea to put code inside a clip rather than on the main timeline.
see if the attach works any better -combined scottys/flashlevel
if it works ok for you i can add the othe features when i get time
boogooloo1
June 30th, 2007, 10:17 AM
I'll give it a go in the morning, mate - thanks very much!!
:):)
boogooloo1
June 30th, 2007, 11:02 PM
Stringy! You're a total legend - works beautifully! :):):)
Go here (http://www.simonwatson.com.au/sb/sbee.html) to check it out. I'd still love those other features if at all possible, but that works great.
Oh, one little thing - is it possible to have the thumbnail for the currently displayed photo to go darker, rather than turn alpha down? I tried itemarray[ii]._brightness = -50, but it didn't do anything.
Cheers again, mate!
:)
stringy
July 1st, 2007, 04:27 AM
Stringy! You're a total legend - works beautifully! :):):)
Go here (http://www.simonwatson.com.au/sb/sbee.html) to check it out. I'd still love those other features if at all possible, but that works great.
Oh, one little thing - is it possible to have the thumbnail for the currently displayed photo to go darker, rather than turn alpha down? I tried itemarray[ii]._brightness = -50, but it didn't do anything.
Cheers again, mate!
:)
no problem
which flash version are you using?
stringy
July 1st, 2007, 05:37 AM
saved as 2004
boogooloo1
July 4th, 2007, 12:19 AM
Sorry, I didn't get email notification that time :h:
I'm on 8, but this'll work fine, I'm sure - will try it soon :)
nywinsitagain
July 5th, 2007, 04:31 PM
I have been reading throug a lot of the posts and need some help.
Here is the flash:
// set random # variables - each must be 0 for first 'while' loop below
var randomNum = 0;
var randomNumLast = 0;
// parent container
var container_mc = this.createEmptyMovieClip("container",0);
// movie clip containers
container_mc.createEmptyMovieClip("loader1_mc",2);
container_mc.createEmptyMovieClip("loader2_mc",1);
// preload watcher
this.createEmptyMovieClip("watcher_mc",100);
// load xml
images_xml = new XML();
images_xml.ignoreWhite=true;
images_xml.onLoad = parse;
images_xml.load("images.xml");
function parse(success) {
if (success) {
imageArray = new Array();
var root = this.firstChild;
_global.numPause = Number(this.firstChild.attributes.timer * 1000);
_global.order = this.firstChild.attributes.order;
_global.looping = this.firstChild.attributes.looping;
_global.fadetime = Number(this.firstChild.attributes.fadetime);
_global.xpos = Number(this.firstChild.attributes.xpos);
_global.ypos = Number(this.firstChild.attributes.ypos);
var imageNode = root.lastChild;
var s=0;
while (imageNode.nodeName != null) {
imageData = new Object;
imageData.path = imageNode.attributes.path;
imageArray[s]=imageData;
imageNode = imageNode.previousSibling;
s++;
}
// place parent container
container_mc._x = _global.xpos;
container_mc._y = _global.ypos;
// parse array
imageArray.reverse();
imageGen(imageArray);
} else {
trace('problem');
}
}
// depth swapping
function swapPlace(clip,num) {
eval(clip).swapDepths(eval("container_mc.loader"+num+"_mc"));
}
function loadImages(data,num) {
if (i==undefined || i == 2) {
i=2;
createLoader(i,data,num);
i=1;
} else if (i==1) {
createLoader(i,data,num);
i=2;
}
}
function createLoader(i,data,num) {
thisLoader=eval("container_mc.loader"+i+"_mc");
thisLoader._alpha=0;
thisLoader.loadMovie(data[num].path);
watcher_mc.onEnterFrame=function () {
var picLoaded = thisLoader.getBytesLoaded();
var picBytes = thisLoader.getBytesTotal();
if (isNaN(picBytes) || picBytes < 4) {
return;
}
if (picLoaded / picBytes >= 1) {
swapPlace("container_mc.loader2_mc",1);
alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeOut,0,100,_globa l.fadetime,true);
timerInterval = setInterval(imageGen,_global.numPause,data);
delete this.onEnterFrame;
}
}
}
function imageGen(data) {
// random, or sequential?
if (_global.order=="random") {
// choose random # between 0 and total number of images
while (randomNum == randomNumLast) {
randomNum = Math.floor(Math.random() * data.length);
trace(randomNum);
}
loadImages(data,randomNum);
randomNumLast = randomNum;
} else if (_global.order=="sequential") {
// start at 0, increment to total number of images, then drop back to zero when done
if (p==undefined || p==data.length && _global.looping=="yes") { p=0; } else { break; }
loadImages(data,p);
p++;
} else {
trace ("order attribute in xml isn't correct - must specify either 'random' or 'sequential'");
}
clearInterval(timerInterval);
}
stop();
Help is greatly appreciated.
boogooloo1
July 6th, 2007, 10:50 PM
saved as 2004
Once again, awesome job, stringy - works beautifully (the darkened current thumb) and love the next/prev buttons :D
If you have time, would LOVE the main pics being links (gather I'd have to add to the xml?), and would also love the description from Scotty's other version added to this one :)
michey
July 7th, 2007, 08:18 PM
Hi
I put a yugop-like ImageSlider together, with a zoom function starting from the code of the infinite-menu/resizing gallery.
It works fine, but the images are zooming from the upper left corner, while I would like to have them zooming from the center of the container.
Can somebody tell me, how this must be done here?
spacing = 10;
pArray = new Array();
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success) {
if (success) {
for (var i = 0; i<this.firstChild.childNodes.length; i++) {
pArray.push(this.firstChild.childNodes[i].attributes.image);
}
}
delay = setInterval(makeSlider, 100);
};
my_xml.load("gallery.xml");
var slider = this.createEmptyMovieClip("slides_tot", 99);
slider.setMask(mask);
var sub_slider = slider.createEmptyMovieClip("slider", 100);
var p = 0;
var i = 0;
var loadper = 0;
function makeSlider() {
clearInterval(delay);
var item = sub_slider.createEmptyMovieClip("pic"+i, i);
item._y = -225;
item.loadMovie(pArray[p]);
var temp = _parent.createEmptyMovieClip("tmp", 9999+i);
temp.onEnterFrame = function() {
var tot = item.getBytesTotal();
var loa = item.getBytesLoaded();
var per = Math.round(((loa/tot)*100)/(pArray.length*2));
loadBar._xscale = loadper+per;
if (tot == loa && tot>4) {
item.id = p;
loadper += per;
if (i>0) {
item._x = sub_slider["pic"+(i-1)]._x+sub_slider["pic"+(i-1)]._width+spacing;
} else {
item._x = -250;
}
item.onRollOver = function() {
this.ZoomDiv(150, 6);
this.swapDepths(1000);
};
item.onRollOut = function() {
this.ZoomDiv(100, 6);
this.swapDepths(500);
};
nextItem();
delete this.onEnterFrame;
}
};
}
var amount = pArray.length-1;
function nextItem() {
if (i<((pArray.length*2)-1)) {
i++;
if (p<(pArray.length-1)) {
p++;
makeSlider();
} else {
p = 0;
makeSlider();
}
} else {
activateSlider();
}
}
var center = Stage.width/2;
var speed = .05;
function activateSlider() {
slider.onEnterFrame = function() {
var distance = _root._xmouse-center;
if (mask.hitTest(_root._xmouse, _root._ymouse)) {
this._x += (distance*speed);
if (this._x<-sub_slider._width/2) {
this._x = 0;
}
if (this._x>0) {
this._x = -sub_slider._width/2;
}
}
};
}
//--------------------------------------------------------------
MovieClip.prototype.ZoomDiv = function(pDim, pTempo) {
this.onEnterFrame = function() {
if (this._xscale<pDim-1/pTempo) {
this._xscale = this._xscale+(pDim-this._xscale)/pTempo;
this._yscale = this._yscale+(pDim-this._yscale)/pTempo;
} else if (this._xscale>pDim+1/pTempo) {
this._xscale = this._xscale+(pDim-this._xscale)/pTempo;
this._yscale = this._yscale+(pDim-this._yscale)/pTempo;
} else {
this._xscale = this._yscale=pDim;
delete this.onEnterFrame;
}
};
};
ASSetPropFlags(MovieClip.prototype, "ZoomDiv", 1);
boogooloo1
July 11th, 2007, 04:25 AM
G'day Stringy,
I worked out how to add the description, although could quite get it to move with the border resizing, so I've left it static, as it is here (http://www.simonwatson.com.au/sb/sbee.html). As you can see, it's below the main pic - would still love it to move with the resizing if at all possible :)
The client is really keen to have each main pic being a link to a bigger version - don't suppose you could fit that in to your busy schedule...? You can get my current version here (http://www.simonwatson.com.au/sb/infinite_dynamic.fla) so I don't have to go back and change everything again, if you don't mind ;)
My XML is currently reading like this:
<?xml version="1.0" ?>
<portfolio>
<picture title="The Trio" image="pics/foto0.jpg" thumb="pics/th0.jpg"/>
<picture title="At Women In Voice" image="pics/foto1.jpg" thumb="pics/th1.jpg"/>
<picture title="Stacey in chair" image="pics/foto2.jpg" thumb="pics/th2.jpg" />
<picture title="Go Chango Live" image="pics/foto3.jpg" thumb="pics/th3.jpg" />
<picture title="Sassy Miss Bee" image="pics/foto4.jpg" thumb="pics/th4.jpg" />
<picture title="Stacey with a scarf" image="pics/foto5.jpg" thumb="pics/th5.jpg" />
<picture title="Go Chango Live" image="pics/foto6.jpg" thumb="pics/th6.jpg" />
</portfolio>
Cheers in advance, mate!!!!
:):):)
boogooloo1
July 12th, 2007, 10:05 PM
I DID IT!!!! I found a post earlier in this thread which had links on the main images, and managed to adapt it :):):)
Thanks to Stringy in particular, and Scotty in general, for all your help!! If anyone's interested, go here (http://www.simonwatson.com.au/sb/sbee.html) and click on gallery (the listen link is pretty cool, too). If anyone wants to check out the fla, you can download it here (http://www.simonwatson.com.au/sb/infinite_dynamic.fla)
:)
function4
July 16th, 2007, 10:51 PM
I thought I had this working but the resize function does not always work. About 10% of the time when I call the loadPic function, it will not resize the border, and will yeild a width of "010" in the output.
spacing = 10;
containerMC._alpha = 0;
//barAll._visible = 0;
MovieClip.prototype.loadPic = function(pic) {
containerMC._alpha = 0;
this.loadMovie(pic);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
barAll._visible = 1;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && containerMC._width != 0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
barAll._visible = 0;
picinfo.info.text = tArray[pic];
delete this.onEnterFrame;
} else {
barAll.bar._xscale = per;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha = 100;
delete this.onEnterFrame;
trace("resize = "+ containerMC._width+spacing);
}
};
};
Is anyone still out there?
mattjp18
July 18th, 2007, 11:03 AM
Can someone explain to me how to have html links on a website point to the different pictures in the slideshow. Is that possible? Instead of having the links as thumbnails or anything else within the flash movie.
Thanks!
Matt
anorexiaRHN
August 8th, 2007, 06:44 PM
also want the resizing slideshow but i want to integrate a scrolling thumbnail...how do i that???
m u r
August 19th, 2007, 08:20 PM
I'm using the V3_multigal_dynamic resizing gallery, but I want each of the thumbnails to loadMovieNum rather than loading a photo. The resize is unnecessary. All I really want is an xml thumbnail gallery that loads an swf rather than a photo. All I could find were galleries. This is the code I'm using now. Any help would be appreciated. Thanks!
var tnNr;
spacing = 10;
container._alpha = 0;
var curLength;
MovieClip.prototype.loadPic = function(pic, id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
bar._visible = 0;
picinfo.info.text = tArray[pic];
containerMC._alpha = 0;
delete this.onEnterFrame;
} else {
bar._width = per;
picinfo.info.text = per+"%";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
info._y = Math.round(this._y+this._height/2+spacing/2);
container._alpha += 5;
if (container._alpha>90) {
info.text = id;
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
var galLength;
my_xml = new XML();
my_obj = new Object();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
var galleries = this.firstChild.childNodes;
galLength = galleries.length;
for (var i = 0; i<galLength; i++) {
my_obj[i] = new Object();
my_obj[i].nodes = galleries[i].childNodes;
var gal_btn = nav_gal.attachMovie("gal_btn", "gal_btn"+i, i);
gal_btn._y = i*20;
gal_btn.label.text = galleries[i].attributes.name;
gal_btn.label.autoSize = true;
gal_btn.bg._width = gal_btn.label._width;
gal_btn.id = i;
gal_btn.onRelease = function() {
galleryChoice(this.id);
disButtons(this.id);
};
}
}
galleryChoice(0);
disButtons(0);
};
my_xml.load("thumbTest.xml");
function galleryChoice(q) {
tArray = [];
pArray = [];
iArray = [];
for (var j = 0; j<curLength; j++) {
this.th_nav["thmb"+j].removeMovieClip();
}
gallery = my_obj[q].nodes;
curLength = gallery.length;
for (var i = 0; i<gallery.length; i++) {
pArray.push(gallery[i].attributes.source);
tArray.push(gallery[i].attributes.thumb);
iArray.push(gallery[i].attributes.title);
}
delay = setInterval(makeButtons, 50);
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%3*50;
thb._y = Math.floor(i/3)*50;
}
loadButtons();
}
function loadButtons() {
var tbox = th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id]);
disButtons2(this.id);
};
}
container.loadPic(pArray[0], iArray[0]);
disButtons2(0);
}
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
this.th_nav["thmb"+i].enabled = 1;
this.th_nav["thmb"+i].box._alpha = 100;
} else {
this.th_nav["thmb"+i].enabled = 0;
this.th_nav["thmb"+i].box._alpha = 50;
}
}
}
function disButtons(d) {
for (var i = 0; i<galLength; i++) {
var but = nav_gal["gal_btn"+i];
if (i != d) {
but.enabled = 1;
but.gotoAndStop(1);
} else {
but.enabled = 0;
but.gotoAndStop(2);
}
}
}
mikenificent
August 25th, 2007, 08:58 PM
What post would show what the actual xml files looks like stringy, I just seen this now and downloaded and needs an xml file so just want to see the xml file so I know how to create it and what to name pics... thanks
ds67
August 28th, 2007, 01:01 AM
Hello everyone:
I'm new to this forum (just signed up tonight). I ran across an old post using the resize.zip file. My question I think is answered in this folder. However, when I try to open it using my Flash 5 program, a get a message 'unexpected file format' that comes up and I cannot view the file. What should/can I do?
sorry to backtrack so far in the past posts.
Thanks so much.
ds
boogooloo1
August 28th, 2007, 09:50 PM
G'day guys,
My band has had some photos done, and I'd like to be able to use the photo gallery and get them to choose their favourites - I'm thinking there'd be a checkbox sitting under the photos, and you click on that when you like a photo. There'd then be a submit button, which would output the results to PHP like a contact form, and email it.
Anyone got the time to try this? I reckon photographers would LOVE it, as they're always sending proofs to clients and getting them to choose favourites.
If you'd like to have a go at altering the code I'm currently using (although if there's a better version out there I can use that), it's the simplest one:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<images>
<pic>
<image>gallery/pic1.jpg</image>
<caption>details</caption>
</pic>
</images>
stop();
bg_mc._visible = false;
inv_btn._visible = true;
desc_txt._visible = true;
bgd._visible = true;
unloadMovie(picture);
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
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;
}
firstImage();
} else {
content = "file not loaded!";
}
}
preloader.preload_bar._xscale=0
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
btns_mc.prev_btn.onRelease = function() {
prevImage();
};
btns_mc.next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
function stuff() {
preloader._visible = true;
var filesize = picture.getBytesTotal();
var loaded = picture.getBytesLoaded();
preloader.preload_bar._xscale = 100*loaded/filesize;
if (picture._width) {
picture._x = bgd._x-picture._width/2;
picture._y = bgd._y-picture._height/2;
preloader._visible = false;
bgd._width += (picture._width-bgd._width)/3;
bgd._height += (picture._height-bgd._height)/3;
if (Math.abs(bgd._width-picture._width)<5) {
bgd._height = picture._height;
bgd._width = picture._width;
picture._alpha += 15;
if (picture._alpha>100) {
delete this.onEnterFrame;
preloader.preload_bar._xscale=0
}
}
}
}
function nextImage() {
if (p<(total-1)) {
p++;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
_root.onEnterFrame = stuff;
desc_txt.text = description[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
_root.onEnterFrame = stuff;
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
_root.onEnterFrame = stuff;
desc_txt.text = description[0];
picture_num();
}
function picture_num() {
current_pos = p+1;
btns_mc.pos_txt.text = current_pos+" / "+total;
}
Hope someone takes this up, as it'd be truly awesome, I reckon :)
Babaloo
September 5th, 2007, 02:17 PM
hey boogooloo,
That "send me" checkbox is indeed a good idea and definitely worth a try.
I've been working on a mod to scotty's thumbs dynamic multi, adapting it to the basic next and previous buttons. Possibly a slide show in the future.
The greatest challenge to me - a real newbie at scripting - was to extract the pic id from the activate function's onRelease method and send it to the prev next buttons. Also I had to set the pic id value in case the prev and next were used before any thumbnail was clicked upon.
I suspect there is a better way to do this, so if any1 could comment, it would be nery nice!
//I think this function loads the gallery X's thumbnails to their containers and id's any given clicked thumbnail,
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id], dArray[this.id]);
//used a global to send clicked pic id to btns.
_global.te = this.id;
disButtons2(this.id);
};
}
I'm not really sure about the global var, but it worked while a simple one didn't. I need to do some homework on functions and scope, I guess...
Once I could extract that id value from thumbnail onRelease, it was a matter of dealing with an undefined value, in case the user did not click on the thumbnails before navigating with next and prev buttons and therefore did not set a value to but.onRelease...
My solution was to assign global = 0 at the beginning of the frame, outside the functions.
The buttons themselves were simple stuff:
nextb.onRelease = function() {
_global.te = _global.te + 1;
if( _global.te >= pArray.length){
_global.te = pArray.length - 1;
container.loadPic(pArray[_global.te],iArray[_global.te],dArray[_global.te])
};
if( _global.te >= 0) {
container.loadPic(pArray[_global.te],iArray[_global.te],dArray[_global.te])
};
}
prevb.onRelease = function() {
_global.te = _global.te - 1;
//this first conditional shouldn't be necessary since global was set to 0, but I havent tested without it yet
if(_global.te == null){
_global.te == 0;
};
if( _global.te <= 0){
_global.te = 0;
container.loadPic(pArray[_global.te],iArray[_global.te],dArray[_global.te]);
status.text = _global.te;
};
if (_global.te > 0) {
container.loadPic(pArray[_global.te],iArray[_global.te],dArray[_global.te]);
status.text = _global.te;
};
}
Well, this is my 2 cents on scotty's great gallery! Hopefully I'll continue to work on new mods and post them here too.
I'm learning a lot at Kirupa and want to sincerely thank everyone who's sharing their efforts here. C:-)
No pics in the attached source files...
leukocyt
February 22nd, 2008, 11:03 AM
Hey guys,
I've read through the entire topic, and tried multiple codes from the attached files (with modifications) but none seems to work for me.
The closers thing to what I need was V3 with infinite thumbs.
Now here's the challenge.
I want to add dynamicly loaded thumbs (loaded from the same XML as the big pictures, but the thumbs are separate images, so there is no scalling involved). I want to position the thumbs in a single row, with the ability to scroll through them with 2 buttons (one scrolls the thumbnails to the left the other to the right).
Also, I would love to be able to preload the thumbs so they don't simply pop up.
And last but not least I would like the thumbs to have reflections (so the reflections would the same image, but upside down and with lower alpha value).
It would be quite important for me to leave the code I have now unchanged (at least as much as possible).
Any ideas?
downtime
February 24th, 2008, 11:46 PM
tried to just keep it simple with the resizing image and a scrolling thumbnail panel (gotoandlearn) and is all being loaded into my main swf. hit a snag when it was loaded into the main swf and the thumb btns aren't working. if there's anyone still paying attention to this thread that could help me out it would be much appreciated. thanx
nlyttle
March 2nd, 2008, 03:27 PM
This thread is definitely one of the best. I've been working on the ability to have galleries added dynamically based on the number of entries in the XML. I think it's looking pretty good so far...
http://www.susansphotographs.com
I'm gonna take some time to strip out some of the excess code unique to this project, and clean it up a bit and I'll post my fla as soon as I can.
Thanks to everyone for all the help!!
downtime
March 26th, 2008, 12:25 AM
This thread is definitely one of the best. I've been working on the ability to have galleries added dynamically based on the number of entries in the XML. I think it's looking pretty good so far...
http://www.susansphotographs.com
I'm gonna take some time to strip out some of the excess code unique to this project, and clean it up a bit and I'll post my fla as soon as I can.
Thanks to everyone for all the help!!
Very nice, I like the attachMovie with the different categories. I would like to see how you did that.
vipeness
March 27th, 2008, 08:26 PM
omgish; just went thru that whole # of pages.. 76 of them.
I have a question, and let me first say... the information in this thread is just amazing.
im trying to put together a simple slideshow/gallery; where like for example there is like a 300x300 area, and 4 images loads on the 300x300 area. they are dynamically loaded thru xml, after about 5 to 10 seconds, they fade to 4 new more images, this just goes thru like a set of 16 images for example. btw, this is all loaded through xml so i change out the images at anytime. now, when you see an image you want to see and make bigger, you just click it to make it bigger, which loads up the larger version of the image, which in the xml file, loads up the larger image, and also, the image doesnt use the whole 300x300 area, maybe like 280x280 centered. after the image is bigger, a note on the bottom shows up that you can click to view that image even bigger, which takes you to a url. if you dont want to see the picture or no longer interested, just click it or after 5 to 10 seconds, it goes back to place, and your looking at the last 4 images. after that, it continues on and keeps loading the image thumbnail from the xml like from the beginning. can someone please help me out, and get me started on how to get this started... im really lost...
CastorX
April 1st, 2008, 04:55 AM
Hi everyone!
First of all, please forgive me when I say, I can' read 75 pages of this thread, and I would try to figure out my problem If I had time, but I hadn't. I'm a very beginner flash designer at a company and I have to finish a job very soon. I used the original xml galery tutorial which works great for me, and I just would like to RESIZE the loaded images to a specific size and it won't work. I've tried out Scotty's script...
Anyway, if someone could help me with this, that would be great.
Babaloo
April 2nd, 2008, 01:16 PM
Hi everyone!
First of all, please forgive me when I say, I can' read 75 pages of this thread, and I would try to figure out my problem If I had time, but I hadn't. I'm a very beginner flash designer at a company and I have to finish a job very soon. I used the original xml galery tutorial which works great for me, and I just would like to RESIZE the loaded images to a specific size and it won't work. I've tried out Scotty's script...
Anyway, if someone could help me with this, that would be great.
Considering Scotty's script
What if you set all images files to the same size before loading them to the image gallery, using an editor like Photoshop etc? Is that what you want? If you want to stretch the images files to any given size you can go two ways:
1. Use a mask for the image loader. This will crop the image, but will give you a steady size withouth distorting/ stretching the image file.
2. Set the container movie clip to your desired size. Find the "container" movie clip instance on the stage, set it's width and height with actionscript. Change container._width and container._height on the onEnterFrame function block inside the resizeMe prototype function...
var w = container._width+spacing, h = container._height+spacing;
Hope this helps :)
Babaloo
April 2nd, 2008, 02:07 PM
Just updating my two cents on Scotty's multigallery script. An older version of the gallery used static links for each of the galleries, so the behavior was linked to timeline frames, as below:
function disButtons(d) {
for (var i = 0; i<galLength; i++) {
var but = nav_gal["gal_btn"+i];
if (i != d) {
but.enabled = 1;
but.gotoAndStop(1);
} else {
but.enabled = 0;
but.gotoAndStop(2);
}
}
}Although the script succeeds in targeting the clicked link, you need to address the dynamic fields used in v3:
function disButtons(d) {
for (var i = 0; i<galLength; i++) {
var but = nav_gal["gal_btn"+i];
if (i != d) {
but.enabled = 1;
my_txt = but.label;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = false;
my_txt.textColor = 0x000000;
my_txt.setTextFormat(my_fmt);
} else {
but.enabled = 0;
my_txt = but.label;
var my_fmt:TextFormat = new TextFormat();
my_fmt.bold = true;
my_txt.textColor = 0xD9541C;
my_txt.setTextFormat(my_fmt);
}
}
}"label" is the dynamic text field instane name. Use textformat and textfield methods as bold, italic and textColor to set the links' behaviours.
luv u Scotty! :yoshi:
CastorX
April 3rd, 2008, 04:02 AM
Hi and thanks for the reply!
As a matter affect the images are loaded from a server via xml and that's why I have to resize them by actionscript because their size are quit different (like 2000*1600px, and 340*500px, etz...).
So I attach my fla and I write down my code here:
My problem is that the next/prev function doesn't work.
stop();
//XML Date Loader
function loadXML(loaded) {
if (loaded) {
var eXmlRoot = this.firstChild;
var eXmlSchema = eXmlRoot.childNodes[0];
var eXmlData = eXmlRoot.childNodes[1];
var eRows = eXmlData.childNodes;
image = [];
country = [];
city = [];
city2 = [];
travel_by = [];
price = [];
money = [];
total = eRows.length;
for (i=0; i<total; i++) {
image[i] = eRows[i].attributes.pic;
country[i] = eRows[i].attributes.klubcount_hunname;
city[i] = eRows[i].attributes.lastmincity_name;
city2[i] = eRows[i].attributes.reg_name;
travel_by[i] = eRows[i].attributes.travty_Name2Price;
price[i] = eRows[i].attributes.cheapest;
money[i] = eRows[i].attributes.pricetype_name2;
if (city[i].length == 0) {
city[i] = city2[i];
}
}
firstImage();
} else {
content = "Error!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("GetMainLastMins.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();
};
var p = 0;
this.onEnterFrame = function() {
preloader._visible = true;
if (l != t) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
}
};
function nextImage() {
if (p<(total-1)) {
p++;
container._alpha = 0;
container.loadPic(image[p]);
country_txt.text = country[p];
city_txt.text = city[p];
travel_by_txt.text = travel_by[p];
price_txt.text = price[p];
money_txt.text = money[p];
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
container._alpha = 0;
container.loadPic(image[p]);
country_txt.text = country[p];
city_txt.text = city[p];
travel_by_txt.text = travel_by[p];
price_txt.text = price[p];
money_txt.text = money[p];
picture_num();
}
}
function firstImage() {
container._alpha = 0;
container.loadPic(image[0]);
country_txt.text = country[0];
city_txt.text = city[0];
travel_by_txt.text = travel_by[0];
price_txt.text = price[0];
money_txt.text = money[0];
picture_num();
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
spacing = 10;
MovieClip.prototype.loadPic = function(pic) {
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w,h);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
container._alpha = 0;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
container._alpha += 5;
if (container._alpha>90) {
container._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
nite21
April 6th, 2008, 09:46 AM
hey scotty nice thread friend
would u help me in pagination i have the fla files
nite21
April 6th, 2008, 09:48 AM
Welcome to the forums, Nick=)
scotty(-:
scotty would u help me in pagination
i have the flash files
my problem is that
1/1 2/1 3/1 the total is showing less
actually i wanted
1/3 2/3 3/3
pixel_streamer
May 1st, 2008, 11:46 AM
check the 4-06-08 entry in the thread linked below. I'm sure the code could be more efficient, although I don't know how to make it so. But it works how I laid it out....
http://www.kirupa.com/forum/showthread.php?t=257111
woodman650
May 1st, 2008, 03:15 PM
not to tack another post onto this already HUGE thread but I was curious... going back to page 1, with the posted example swf...
Is there a way to resize while keeping one side of the image/movieclip stationary? What I mean is, if you have the movieclip resting on the bottom of the stage, it only would resize up, left, and right to accomodate the image, not down. You'd disable the ability for the resize to work downward, it would compensate by stretching up twice as much.
I hope that makes sense... please let me know if it doesn't or can be done. Thanks in advance!
grmachn
July 10th, 2008, 07:05 PM
This has been a really enlightening thread. I have been able to use almost all of the code here and it has been very helpful. However, I have an issue that is totally frustrating me. I am trying to have more than one resizable border changing at the same time to show 2 different pictures at the same time when you click the same button. It seems however that the code for one cancels the other out, so that only one of the mcs resizes and loads the next image. Any ideas why this may be happening?
stringy
July 11th, 2008, 07:23 PM
on your buttons
on (release) {
loadPic("pic2.jpg", "pic3.jpg");
}
and
on(release){
loadPic("pic1.jpg","pic4.jpg");
}
remove all the code in the second layer of your main timeline
change the first layer code to
spacing = 10;
container2MC._alpha = 0;
containerMC._alpha = 0;
function loadPic(pic1,pic2){
trace(pic1)
_root.container2MC._alpha = 0;
_root.containerMC._alpha = 0;
containerMC.loadMovie(pic1);
container2MC.loadMovie(pic2);
_root.onEnterFrame = function(){
if(containerMC._width && container2MC._width){
var w2 = container2MC._width + spacing, h2 = container2MC._height + spacing;
border2.resizeMe(w2, h2,container2MC);
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h,containerMC);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h,clip){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
clip._x = this._x - this._width/2 + spacing/2;
clip._y = this._y - this._height/2 + spacing/2;
clip._alpha = 100;
delete this.onEnterFrame;
}
}
};
Babaloo
August 28th, 2008, 01:48 PM
prolly the longest thread in kirupa history. Learned a lot from this. love this gallery and really appreciate all the effort put into it.
scotty
August 28th, 2008, 05:28 PM
Hi Nite, I'm Scotty's wife. He passed away february 14th.
Sorry.
Yvon
hey scotty nice thread friend
would u help me in pagination i have the fla files
kfrazier
September 17th, 2008, 01:02 AM
ok.. I've searched through this thread and have not found a solution to my problem. I apologize if it is in here and I overlooked it. Luckily, I am certain that this is a fairly basic problem that you all should have a quick fix for. I am new to actionscripting so it is probably an error on my part.
After doing the Adding Thumbnails tutorial I found other posts on making the thumbnails vertical instead of horizontal. Works fine with the images supplied in the tutorial. When I put my own images in the xml file they do not display correctly. The area for the large image will not display the entire image (it is the correct size) and my thumbnails will not display. If I put just one thumbnail of my own image and use the other thumbnails from the tutorial they show up. I don't know what I am doing wrong, and advice?
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
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;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.UP) {
prevImage();
} else if (Key.getCode() == Key.DOWN) {
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;
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.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._width)) {
if ((_root._ymouse>=(hit_right._y-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._y -= scroll_speed;
} else if ((_root._ymouse<=(hit_left._y+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._y += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._y =(target_mc._height+5)*k;
//trace(target_mc._width+" "+target_mc._parent._rotation)
target_mc.pictureValue = k;
target_mc.onRelease = function() {
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);
}
nubian
March 24th, 2009, 12:55 AM
awesome thread!
could i please get some assistance on how to preload the images being loaded to this version:
http://www.kirupa.com/forum/showpost.php?p=1169438&postcount=2
thanks in advance
keceutike
August 7th, 2009, 09:28 AM
So, this is a new problem - so far Mobipocket files both DRM and not-DRM on my iLiad have been working just fine. But, today I opened a Mobipocket file Ive been reading, and it opened on the first page, and not on the last page read. Ive tried it a few more times, and this happened everytime.I was wondering if anybody had the same problem, and if so, how it was solved?p.s. This mobipocket file was created from pdf file in Mobipocket Desktop Reader.
Linx
August 26th, 2009, 07:14 AM
Wow!
Very very useful! I found lots of useful info in this thread.
Thank you, guys!
omgnoseat
September 16th, 2009, 10:56 AM
Not sure if this is the right place, but I don't think it deserves it's own topic.
I have an image gallery and I want to resize the images when they are loaded, but I have no idea where to put the resize event. Most of the time the images don't show up anymore when the resize function has run.
This is code:
import gs.*;
import gs.easing.*;
//setting a var for the requested xml
var xmlRequest:URLRequest = new URLRequest("gallery3.xml");
//a loader vor the request
var xmlLoader:URLLoader = new URLLoader (xmlRequest);
//loader for the image in the xml we are loading
var imageLoader:Loader;
//imagedata will declare the parts from the xml we will be using
var imageData:XML;
//vars for declaring parsed xml data
var rawImage:String;
//image width and height
var rawH:String;
var rawW:String;
var imgNum:Number = 0;
//counter for the images placed in the grid
var xCounter:Number = 0;
var yCounter:Number = 0;
//total number of images
var total:Number;
//need to place it in a movieclip to be able to resize and place it
var thumbContainer:MovieClip;
var fullContainer:MovieClip;
xmlLoader.addEventListener(Event.COMPLETE, xmlLoadedF);
function xmlLoadedF (event:Event):void{
//var for path to data from the xml root
imageData = new XML(event.target.data);
//raw image is loading the url of the image
rawImage = imageData.image[imgNum].imageURL;
//total amount of images counted by the amout of urls
total = imageData.image.imageURL.length();
//load the descriptions from the current image number [0];
//tekstVak.text = imageData.image.descriptions[imgNum].text();
//tekstVak.text = imageData.image.descriptions.text();
//width and height based on the xml imgH and imgW
rawH = imageData.image[imgNum].imgH;
rawW = imageData.image[imgNum].imgW;
createContainer();
callThumbs();
}
function createContainer():void{
//create a movieclipholder for the images
thumbContainer = new MovieClip();
thumbContainer.x = 30;
thumbContainer.y = 30;
addChild(thumbContainer);
//resize();
}
function callThumbs():void{
//i is the number of images, keep adding images (with ++) till the total is reached
for (var i:Number = 0; i < total; i++){
var thumb_loader = new Loader();
//assign a name we can call when we want to vieuw the full image
thumb_loader.name = i;
thumb_loader.load(new URLRequest(imageData.image[i].imageURL));
//setting the width and height for each image
thumb_loader.x = (Number(rawW)+10)*xCounter;
thumb_loader.y = (Number(rawH)+10)*yCounter;
//set begin value for the animation
thumb_loader.alpha = 0;
thumb_loader.scaleX = 0.85;
thumb_loader.scaleY = 0.85;
//if the counter is smaller than 5 (number of rows), keep adding to xCounter, if it isn't, set it to 0;
//counter begins at 0, so +1 it in the beginning
if (xCounter+1 < 4){
xCounter++;
} else {
xCounter = 0;
yCounter++;
}
thumb_loader.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, thumbLoaded);
//resize it
//thumb_loader.contentLoaderInfo.addEventListener(Ev ent.COMPLETE, resizeThumb);
}
}
function thumbLoaded(e:Event):void{
//when the thumb is loaded, add it to the stage and make it clickable
var my_thumb:Loader = Loader(e.target.loader);
thumbContainer.addChild(my_thumb);
TweenMax.to(my_thumb, 3, {scaleX:1, scaleY:1, alpha:0.8, ease:Elastic.easeOut});
thumbContainer.addEventListener(MouseEvent.CLICK, callFull);
thumbContainer.addEventListener(MouseEvent.MOUSE_O VER, overThumb);
thumbContainer.addEventListener(MouseEvent.MOUSE_O UT, outThumb);
my_thumb.contentLoaderInfo.removeEventListener(Eve nt.COMPLETE, thumbLoaded);
}
/*function resizeThumb(e:Event):void{
var my_thumb:Loader = Loader(e.target.loader);
my_thumb.alpha = 1;
my_thumb.width = 100;
my_thumb.height = 100;
//e.currentTarget.width = 100;
//e.currentTarget.height = 100;
thumbContainer.width = Number(rawW)
thumbContainer.height = Number(rawH);
}*/
function overThumb(e:MouseEvent):void{
var my_thumb:Loader = Loader(e.target);
my_thumb.alpha = 1;
}
function outThumb(e:MouseEvent):void{
var my_thumb:Loader = Loader(e.target);
my_thumb.alpha = 0.8;
}
function callFull(e:MouseEvent):void{
var full_loader:Loader = new Loader();
//the url depends on the .name which is i [which is the name], so if i=1, the first image will be loaded
var full_url = imageData.image.imageURL[e.target.name];
full_loader.load(new URLRequest(full_url));
full_loader.contentLoaderInfo.addEventListener(Eve nt.INIT, fullLoaded);
createFull();
}
function createFull():void{
fullContainer = new MovieClip();
fullContainer.x = 30;
fullContainer.y = 30;
}
//function to place the full image
function fullLoaded(e:Event):void{
//load the clicked image at the center of the stage
var my_loader:Loader = Loader(e.target.loader);
my_loader.x = (stage.stageWidth/2) - my_loader.width/2;
my_loader.y = (stage.stageHeight/2) - my_loader.height/2;
fullContainer.addChild(my_loader);
addChild(my_loader);
fullContainer.addEventListener(MouseEvent.CLICK, closeFull);
}
function closeFull(e:MouseEvent):void{
var my_loader:Loader = Loader(e.target.loader);
fullContainer.removeChild(my_loader);
}
Would appreciate help, been fiddling with this for quite some time now :(
nygauk
September 25th, 2009, 05:43 PM
Here's a little something for you niki ;)
Hi I have found resize.zip very useful. How could I modify the .fla to read image names from an xml file using a previous and next button rather than using thumbnails?
I would very much appreciate your help.
Thanks
David
gargamuza
October 13th, 2009, 11:12 AM
Hi Nite, I'm Scotty's wife. He passed away february 14th.
Sorry.
Yvon
Yvon, I am sorry to read this.
Dani
deanpowel71
October 20th, 2009, 06:48 AM
resize.zip was really great. Its always nice to have such things.
gargamuza
October 29th, 2009, 02:55 PM
Hola Luis, do you till have this file: V3_thumbs_scrolled.fla? I lost it and I need it.
If you do, I would be more than happy.
Thanks
Hi,
I'm "another" Flash Rookie and i'm learning a lot with you guys, so first of all i want to say "thanks a bunch" to all of the gurus for all your time.
If i'm allowed i want to give a different use to this gallery, i would like to use as a news list, so in the selector i need to put (besides the thumb) a title and a few phrases of the complete news.
I know i will need a extra field on the xml to allocate the title and another for the "resumed news" text (i can use the info field for the complete news).
but i'm not good with the dinamic created movie clips, so i cannot add the extra fields to the selector.
Could anybody help me?
oh! by the way, i'm using V3_thumbs_scrolled.fla file
:hugegrin:
Luis
The LostOne
gargamuza
October 29th, 2009, 03:24 PM
Hello people. Does someone have this file: V3_thumbs_scrolled.fla
Thanks a lot
gargamuza
October 29th, 2009, 09:10 PM
Community, Russell Heimlich took the time today to send me the fla files for these galleries.
Can be found here: www.thiez.com/galleries.zip (http://www.thiez.com/galleries.zip)
Thanks Russell
all-forgiving
November 24th, 2009, 06:38 PM
is that in ActionScript 2? Anybody has ActionScript 3 version?
Snapdragon
January 30th, 2010, 08:26 AM
Hi all. I found this thread while browsing the internet for a way to modify a flash template I have. I think this is the right place, but correct me if I'm wrong.
I am looking for a way to make the images that load in the background via the photo gallery (and the image on the main page) to scale properly with the browser size. An example of what I want to achieve:
http://flashden.net/files/6421/index.html
And here is a link to my website:
www.snapdragonstudios.co.uk
You can see the image on the main page stays the same size, whether in fullscreen mode or in windowed mode. Also if you go to the gallery you will find I have inserted the same image in several different sizes to give you an idea of what it does when I insert images.
I will be honest and say I have absolutely no idea how to edit flash or html or anything like that and I use an admin tool to edit the text/images in the template. I do have flash / dreamweaver though so if someone could possibly give me -really- detailed instructions I might be able to work it out. I would appreciate any help anyone could give me.
A link to download my template:
https://rcpt.yousendit.com/811713036/b2b69d759e9ebe911b8bf8939c568445
hoodz
February 14th, 2010, 03:37 PM
Is it possible to use Scotty's resize gallery which loads up swf's instead of jpegs? Havent been using actionscript for a while and I am only able to break it instead of make it work with swf :(
what I want is to get it to load jpeg as thumbnail and swf as the main "image"
mattiasfromswed
March 14th, 2010, 03:11 PM
Hi all. I found this thread while browsing the internet for a way to modify a flash template I have. I think this is the right place, but correct me if I'm wrong.
I am looking for a way to make the images that load in the background via the photo gallery (and the image on the main page) to scale properly with the browser size. An example of what I want to achieve:
http://flashden.net/files/6421/index.html
And here is a link to my website:
www.snapdragonstudios.co.uk
You can see the image on the main page stays the same size, whether in fullscreen mode or in windowed mode. Also if you go to the gallery you will find I have inserted the same image in several different sizes to give you an idea of what it does when I insert images.
I will be honest and say I have absolutely no idea how to edit flash or html or anything like that and I use an admin tool to edit the text/images in the template. I do have flash / dreamweaver though so if someone could possibly give me -really- detailed instructions I might be able to work it out. I would appreciate any help anyone could give me.
A link to download my template:
https://rcpt.yousendit.com/811713036/b2b69d759e9ebe911b8bf8939c568445
Hi Snapdragon can you by any chance update the download link to your template, it wont work to download the file(s) due to it has expired.
Thanks! :D
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.