Scotty's Image Resize Gallery
Hello,
This is my first post at this forum. Wow great information.
I've downloaded Scotty's Image Resize Gallery found at http://www.kirupa.com/forum/showthread.php?t=87388
and I would like to replace the jpegs with external swf's. I tried replacing the images and it loads the first movie but then it just freezes. I was wondering if somebody would be able to help me with this. Thank you.
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 03-02-2005, 08:15 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Scotty's Image Resize Gallery
I'm trying to create a photo gallery for a site that I'm working on and I'm having some trouble. Some of the pictures will show up, but not all of them. I've tried to figure out what's wrong, but I have no clue. Can someone help me out? The gallery that I'm using is one that I found here: http://www.kirupa.com/forum/showthread.php?t=87388
Here's the link to the gallery
http://www.cindyambuehl.net/photos.html
Here's my fla
http://www.cindyambuehl.net/photos.fla
Scotty's Image Resize Gallery
Hi Everyone
I found this great thread Scotty's Image Resize Gallery and have been playing around with some of the files. The one things no-one has mentioned in all of the posts, is how you might be able to customise the border.
I see where it is written in the code, but what I really need to do is create a scribbly line rather than a straight one. It seems best to create mc and then have this re-size and stretch as the images re-size.
Has anyone got a clue how or if this can be done easily to the code already in palce?
Tnx
Loading Bar Within Scotty's Image Resize Gallery
I have the gallery working perfectly, i also have a loading bar script ive got seperatly working. But does anyone know how i can work the 2 together so that as an image loads the loading bar shows in the centre of the box?
thanks
Help With Scotty's Image Resize Gallery In A Website
help with Scotty's Image Resize Gallery in a website
Hello, great people of Kirupa!
With the help of your tutorials i did my first website in flash. I am sorry if my english is not "perfecto". The site i from a friend photographer that a have.
It is not fully fully completed but, the base is done and you can meet it in:
www.joseluisgarcia.com.ar
The only problem that i cannot handle by myself is a sort of BUG that i encountered in the galleries. If you try to see any image more than twice, the buttons of the entire gallery becomes disabled.
¿Can somebody give me a solution for that?
I would like take opinions of the web site too.
Well, thanks for at least read this message.
__________________
Scotty's Image Resize Gallery XML Question
so im using this wonderful gallery.. and im in some problems that its prob pretty simple to answer..
im using v3 with thumbs version.. and all i wanted to do was make it to where the descriptions of the pictures.. some of the words i would like to be in bold, but since its dynamic text, im guessing that some simple code needs to be added to the xml file??
Quote:
<?xml version="1.0" encoding="UTF-8"?>
<menu>
<gallery name="Holiday">
<image source="pics/pic1.jpg" thumb="pics/th1.jpg" title="Black Helium Acrylic On Wooden Panel 39.5 x 12.5 2004"/>
<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Party"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Bench"/>
<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Lights"/>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Face"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic9.jpg" thumb="pics/th9.jpg" title="My Girlfriend"/>
<image source="pics/pic1.jpg" thumb="pics/th1.jpg" title="Earth"/>
<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Party"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Bench"/>
<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Lights"/>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Face"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic9.jpg" thumb="pics/th9.jpg" title="My Girlfriend"/>
<image source="pics/pic1.jpg" thumb="pics/th1.jpg" title="Earth"/>
<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Party"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Bench"/>
<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Lights"/>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Face"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic9.jpg" thumb="pics/th9.jpg" title="My Girlfriend"/>
</gallery>
<gallery name="Birthday">
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Face"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic9.jpg" thumb="pics/th9.jpg" title="My Girlfriend"/>
</gallery>
<gallery name="Christmas">
<image source="pics/pic4.jpg" thumb="pics/th4.jpg" title="Lights"/>
<image source="pics/pic5.jpg" thumb="pics/th5.jpg" title="Agreement"/>
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>
</gallery>
<gallery name="New Year">
<image source="pics/pic6.jpg" thumb="pics/th6.jpg" title="Landscape"/>
<image source="pics/pic7.jpg" thumb="pics/th7.jpg" title="Face"/>
<image source="pics/pic8.jpg" thumb="pics/th8.jpg" title="Sunset"/>
<image source="pics/pic1.jpg" thumb="pics/th1.jpg" title="Earth"/>
<image source="pics/pic2.jpg" thumb="pics/th2.jpg" title="Party"/>
<image source="pics/pic3.jpg" thumb="pics/th3.jpg" title="Bench"/>
</gallery>
</gallery>
i tried stuff like <b> </b> but it just wouldnt work.
any help with this would be much appreciated.. if anyone has any ideas or different ways of doing this.. im all for it!
thanks
ps. this is where i got the gallery in the first place:
http://kirupa.com/forum/showthread.php?t=87388
Tweaks To Scotty's Image Resize Gallery
Before I go and spend a number of hours trying to figure it out - has anyone made the following improvements to Scotty's "V3_with_thumbs" gallery?
http://www.kirupa.com/forum/showthread.php?t=87388
1) Gallery menu is fed by the XML doc and not hardcoded in Flash.
2) Next and Previous buttons (in addition to the thumbnail buttons)
3) Icing on the cake: "Slideshow" button that loops through the chosen gallery thumbnails. Probably needs to be a toggle button to stop the loop too.
Issue With Alteration Of Scotty's Image Resize....
I have a loop that dynamically loads thumbnails into a movie clip. As each thumb is loaded, it calls on a preloader function. This works for all the thumbs except the first one! No matter which one is the first one, it won't work on the first thumb.
The code is as follows:
ActionScript Code:
function makeButtons() { tnNr = 0; clearInterval(delay); for (var i = 0; i<tArray.length; i++) { var thb = main_thumbs_mc.thumbClip.duplicateMovieClip("thmb"+i, 1000+i); thb.id = i; thb._x = 10+(i%5*118); thb._y = 20+(Math.floor(i/5)*137); } loadButtons();}function loadButtons() { var tbox = main_thumbs_mc["thmb"+tnNr].thumbEmpty; trace(tbox); tbox.loadMovie(tArray[tnNr]); tbox._parent.preLoader(); temp = this.createEmptyMovieClip("tmp"+tnNr, 999); temp.onEnterFrame = function() { bt = tbox.getBytesTotal(); bl = tbox.getBytesLoaded(); if (bt == bl && bt>4) { tbox._x += (tbox._parent._width-tbox._width)/2; tbox._y += (tbox._parent._height-tbox._height)/2; nextButton(); delete this.onEnterFrame; } };}
the part that
says "tbox._parent.preLoader" is where the preloader is called, and I placed a trace() command in the preloader and it traces on every thumb except the first one. I thought maybe it was because it had an instance of 0, so I assigned tnNr a value of 1 and I also tried 5. And same thing. The first thumb (In this case, the second one or 6th one) did not load the preloader.
IS there something wrong with the code? Anyone have any ideas why this might be?
thanks a bunch.
Scotty's Image Resizing Gallery Question...
I m trying to use scotty's infinite resizing image gallery for a project of mine and I was wondering if there was any way to make a vertical scroller for the thumbnails on the left of the actual image with two rows of images rather than just one. I'm new to the forum and I see that a lot of people get helped and I was hoping that someone here might be able to help. Thank you.
Adding Fancy Border To Scotty's Image Gallery
I'm encountering a weird glitch when I try to use a more complex image border: the image container and the text caption both jump into place at the last moment. A bad effect. All I've done is add two more variables, "w2" and "w3" to the code:
Code:
var w = container._width+spacing, h = container._height+spacing;
var w2 = container._width+space2, h2 = container._height+space2;
var w3 = container._width+space3, h3 = container._height+space3;
border.resizeMe(w, h, id);
border2.resizeMe(w2, h2, id);
border3.resizeMe(w3, h3, id);
The effect can be see here:
http://www.tornedgedesign.com/_test/...i_borders.html
The only way I can find to keep the border shapes in correct proportion is to create 3 different border clips and apply the "resizeMe" easing function to each of them.
Files are here - thanks for any help:
http://www.tornedgedesign.com/_test/...ti_borders.zip
Image Resize In Gallery AS3
Hi,
I am having problems resizing images so they will fit a standard size format in my gallery. This is causing problems mainly with portrait images in the gallery really..
Bellow are my scripts... any replies would be appriciated!
//Script to make images appear on a timer//
var autoRotate = 0;
var imageTimer:Timer = new Timer(7000);
imageTimer.addEventListener(TimerEvent.TIMER, readImages);
function readImages(event:TimerEvent):void{
if(autoRotate == 0){
imageTimer.start();
trace("fired");
top.alpha = 100;
holderClip.removeChildAt(0);
if(increment < total-1){
increment += 1;
} else {
increment = 0;
}
textFieldA.text = TITLES[increment];
textFieldB.text = COPYS[increment];
ImageLoad(LINKS[increment],holderClip,0,0);
imageNUMB.text = increment+1 + " of " + total;
}
}
//Script to load images
import flash.display.*;
import flash.events.*;
import flash.net.URLRequest;
import flash.net.URLVariables;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var numOfImages = 90;
var imgNum = 0;
function ImageLoad(u:String,target,Ypos,Xpos){
var targetClip = target;
var positionY = Ypos;
var positionX = Xpos;
var _loader:Loader = new Loader();
var request:URLRequest = new URLRequest(u);
_loader.load(request);
targetClip.addChild(_loader);
//targetClip.y = positionY;
//targetClip.x = positionX;
_loader.contentLoaderInfo.addEventListener(Progres sEvent.PROGRESS, loadProgress);
_loader.contentLoaderInfo.addEventListener(Event.C OMPLETE, completeHandler);
}
function loadProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
percentLoaded = Math.round(percentLoaded * 100);
if(percentLoaded > 20){
trace("firing");
preLoader.alpha = 100;
} else{
preLoader.alpha = 0;
}
}
function completeHandler(event):void {
trace("DONE");
preLoader.alpha = 0;
var myTween:Tween = new Tween(top, "alpha", Strong.easeOut, 1, 0, 1, true);
imageTimer.start();
}
//Script to load xml file//
var loader:URLLoader;
loader = new URLLoader();
var increment = 0;
var total = 0;
var i = 0;
var TITLES = [];
var COPYS = [];
var LINKS = [];
//ADD EVENT LISTENER, THIS LISTENS FOR WHEN XML IS LOADED
loader.addEventListener(Event.COMPLETE, xmlLoaded);
//DEFINES XML FILE THAT IS LOADED
var request:URLRequest = new URLRequest("featured_flash.xml");
loader.load(request);
//FUNCTON CALLED ONE XML IS LOADED
function xmlLoaded(event:Event):void {
//DEFINE MY XML VARIABLE
var myXML:XML = new XML(loader.data);
total = myXML.children().length();
trace(total);
imageNUMB.text = "1 of " + total;
textFieldA.text = myXML.children().TITLE.children()[0];
textFieldB.text = myXML.children().COPY.children()[0];
ImageLoad(myXML.children().LINK[0],holderClip,0,0);
for (i=0; i<total; i++) {
TITLES[i] = myXML.children().TITLE.children()[i];
COPYS[i] = myXML.children().COPY.children()[i];
LINKS[i] = myXML.children().LINK.children()[i];
}
}
//Script to function gallery//
//setup reset button
nextButton.addEventListener(MouseEvent.MOUSE_DOWN, nextBut);
//reset timer on call
function nextBut(event:MouseEvent):void {
autoRotate = 1;
top.alpha = 100;
holderClip.removeChildAt(0);
if(increment < total-1){
increment += 1;
} else {
increment = 0;
}
textFieldA.text = TITLES[increment];
textFieldB.text = COPYS[increment];
ImageLoad(LINKS[increment],holderClip,0,0);
imageNUMB.text = increment+1 + " of " + total;
trace(increment);
}
previousButton.addEventListener(MouseEvent.MOUSE_D OWN, prevBut);
//reset timer on call
function prevBut(event:MouseEvent):void {
autoRotate = 1;
top.alpha = 100;
holderClip.removeChildAt(0);
if(increment > 0){
increment -= 1;
} else {
increment = total-1;
}
textFieldA.text = TITLES[increment];
textFieldB.text = COPYS[increment];
ImageLoad(LINKS[increment],holderClip,0,0);
imageNUMB.text = increment+1 + " of " + total;
trace(increment +"one")
}
Image Resize Gallery
I'm using Scotty's Image Resize Gallery for my website and I've noticed that some of the pictures refuse to show up after I load them. I don't understand why. I've tried and tried, but they still won't show. Here's the site...
http://heathertom.net/ia.html
The pics that won't show are mostly on the exclusives page. This only happens with certain pictures.
Here's my code for the xml
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.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("http://www.heathertom.net/pics/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%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);
}
butArray = new Array();
butArray = ["gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn", "gal5_btn", "gal6_btn", "gal7_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);
XML Photo Gallery And Resize Image
Hi I just finished the excellent Tute on Photo Gallery with XML and the additional Thumbnail scroller. It all works great except for images that are smaller than MC specified parameters. In the tute, all the images are the same size and fill the image viewing area perfectly. However, if you have vertical or odd-shaped images they load the the upper left corner.
My question is two-fold:
Does the auto-center and/or auto-resize code need to be in the XML file or in Flash AS
Where does the code go and what do I need to specify
Thanks in advance
Preloader For Image-resize Gallery
Hey, great forums, you guys sure know your stuff around here. I currently have a bit of a problem, i'm trying to create an image-resize gallery with a preloader. This is currently what it looks like:
containerMC
button1
Actionscript on frame1
Code:
spacing = 10;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function (pic)
{
containerMC._alpha = 0;
this.loadMovie(pic);
onEnterFrame = function ()
{
var t = containerMC.getBytesTotal();
var l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l / t) == 1 && containerMC._width > 2)
{
var w = containerMC._width + spacing;
var h = containerMC._height + spacing;
border.resizeMe(w, h);
delete onEnterFrame;
} // end if
};
};
MovieClip.prototype.resizeMe = function (w, h)
{
var speed = 3;
this.onEnterFrame = function ()
{
this._width = this._width + (w - this._width) / speed;
this._height = this._height + (h - this._height) / speed;
if (Math.abs(this._width - w) < 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 = containerMC._alpha + 9;
if (containerMC._alpha > 90)
{
containerMC._alpha = 100;
delete this.onEnterFrame;
} // end if
} // end if
};
};
and on button1 i have
Code:
on (release)
{
containerMC.loadPic("image.jpg");
}
I was just wondering if anyone knew an easy way of setting a preloader of some sort to load the .jpg and then resizes?
Cheers for taking the time to read my post
Dynamic Image Gallery Resize
Hey guys, come on!!! A little help here. PLEEEEEEEEEEEASE!!!!
I'm trying to get the images on my gallery to resize. I tried several times but was unsuccessful at it.
Here's how it looks now:
Code:
this.onEnterFrame = function() {
filesize = container_mc.picture_mc.getBytesTotal();
loaded = container_mc.picture_mc.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (container_mc.picture_mc._alpha<100) {
container_mc.picture_mc._alpha += 10;
}
if(container_mc.picture_mc._width > 0) {
resizeImage();
}
container_mc.picture_mc._x = (container_mc._width-container_mc.picture_mc._width)/2;
container_mc.picture_mc._y = (container_mc._height-container_mc.picture_mc._height)/2;
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
container_mc.picture_mc._alpha = 0;
container_mc.picture_mc.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
container_mc.picture_mc._alpha = 0;
container_mc.picture_mc.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
if (container_mc.picture_mc._width>0) {
}
}
}
function firstImage() {
if (loaded == filesize) {
container_mc.picture_mc._alpha = 0;
container_mc.picture_mc.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
_global.resizeImage = function() {
//maximum image dimensions
wMax = 420;
hMax = 340;
if (container_mc.picture_mc._width>wMax || container_mc.picture_mc._height>hMax) {
//which dimension is the most oversized
wDiff = container_mc.picture_mc._width-wMax;
hDiff = container_mc.picture_mc._height-hMax;
//calculate ratio
if (wDiff>hDiff) {
ratio = (wMax/container_mc.picture_mc._width)*100;
} else {
ratio = (hMax/container_mc.picture_mc._height)*100;
}
} else {
//if image doesn't need to be resized set ratio to 100
ratio = 100;
}
container_mc.picture_mc._xscale = container_mc.picture_mc._yscale=ratio;
};
As it is, the picture just keeps resizing itself non-stop. I already tried to use the resizeImage(); in the nextImage and prevImage functions, but it would only resize the images some times.
Anyone care to enlighten me on where I might be wrong? Any help will be welcome! Thanks in advance for any answers!
Image Gallery With Xml, Fullscreen, Resize Etc.
Hi all,
I would like to:
Build a image gallery
- with xml support
- loader
- timer that changes to next picture
- navigation with thumbs, back & forth, play, stop
- image that adapts to screen size/fullscreen
Something like this page's look book http://www.marc-aurel.com/2007/
Any good threads/tutorials you can tip me (my actionscripting is pretty rusty)
Help very appreciated!!
Thx
Xml Slideshow With Resize And Fade (help Scotty)
i'm using the code from the best of kirupa thread about the gallery with resize.
it's working with what i've done with it so far but it's 'jerky' on resize. at the last point of the resize the frame clip jumps to the correct size. I can't seem to get a handle on why it does that.
at this point i'm using a simple clip to control the timing of the fade (if I could target fp 8, i would use the tween class and .onMotionFinished) so that there's a slight delay between the resize and the container clip fading in the image. IF somebody could give me a better method that would be great.
Also, for the loading of the subsequent images, i was planning on using some type of timer (maybe setinterval) to wait for 10 seconds or so until I call the next xml node and load the next image. If anyone can comment on which method is best for a timer situation like that it would also be greatly appreciated.
here's code and i'm attaching my .fla, xml and the first image (only working with that one at this point):
Code:
spacing = 20;
containerMC._alpha = 0;
theFade=0;
imagesXML=new XML();
imagesXML.ignoreWhite=true;
imagesXML.onLoad=function(success){
if(success){
rootNode=imagesXML.firstChild;
totalSlides=rootNode.childNodes.length;
firstNode=rootNode.firstChild;
trace(firstNode.attributes.url);
loadClip(firstNode);
}
}
imagesXML.load("images.xml");
loadClip=function(nextNode){
container._alpha=0;
trace(nextNode.attributes.url);
container.loadMovie(nextNode.attributes.url);
_root.onEnterFrame = function(){
var bytesT = container.getBytesTotal(), bytesL = container.getBytesLoaded();
if (bytesT != 0 && Math.round(bytesL/bytesT) == 1){
var w = container._width + spacing, h = container._height + spacing;
trace("this is the width: "+w+" this is the height: "+h);
resizeMe(w, h);
delete _root.onEnterFrame;
}
}
}
resizeMe = function(w, h){
var speed = 11;
border.onEnterFrame = function(){
border._width += (w - border._width)/speed;
border._height += (h - border._height)/speed;
if( Math.abs(border._width-w)<1){
border._width = w+spacing/2;
border._height = h;
_root.container._x = border._x - border._width/2 + spacing/2 ;
_root.container._y = border._y - border._height/2 + spacing/2;
delete border.onEnterFrame;
_root.timerClip.gotoAndPlay("start");
}
}
};
Applying Resize To Kirupa's Image Gallery?
Ive been at this for a awhile and getting stuck every time. I can't seem to integrate resize property into kirupa's code. The reason I'm doing this is other than I like the resizing effect I also want to have the images centered. (there is 2 standard different size images I'm using.
I apologize in advance for all the code pasting. But thanks in advance for any help!
This is the code I found that will apply the resizing effect.
ActionScript Code:
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;
}
}
};
This is Kirupa's code.
ActionScript Code:
this._lockroot = true;
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.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
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._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-150)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+150)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += 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._x = hit_left._x+(target_mc._width+5)*k;
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);
}
Dynamic Resize Of Photos In Image Gallery
Hello!
I know I've seen this thing done someplace, but I cannot remember where and cannot find it. The effect is that when a picture is loaded in the photo gallery, the outline (of the movieclip it is loaded into) resizes itself very smooth to the dimensions of the picture loaded. Does anyone knows where can I find a tutorial about smth like this, an example or maybe just an idea on how I can do it?
Thanx.
Image Gallery - Resize The Images, Not The Slideshow
I'm working on an xml driven flash website where clients can modify an xml file directly to change the appearance of the site (eventually i'll make a flash/php dashboard GUI). The site will have listings each with a photo.
I'm trying to find a way around having the clients have to crop images to thumbnail and enlarged view size themselves. In other words the images would be displayed scaled to fit within a movie clip. Does anyone know if this is even possible? It seems that an image is an image at its pixel dimensions and there's no real way around that...
I guess my target demographic is pretty tech savvy (relatively) and could probably crop images with a basic image editor... it would be nice to find them some kind of batch processor or something. Although at the most clients will probably only add five or ten listings a month or so. if anyone has any insight into this dilemma that would be appreciated!
Image Gallery - Resize The Images, Not The Slideshow
I'm working on an xml driven flash website where clients can modify an xml file directly to change the appearance of the site (eventually i'll make a flash/php dashboard GUI). The site will have listings each with a photo.
I'm trying to find a way around having the clients have to crop images to thumbnail and enlarged view size themselves. In other words the images would be displayed scaled to fit within a movie clip. Does anyone know if this is even possible? It seems that an image is an image at its pixel dimensions and there's no real way around that...
I guess my target demographic is pretty tech savvy (relatively) and could probably crop images with a basic image editor... it would be nice to find them some kind of batch processor or something. Although at the most clients will probably only add five or ten listings a month or so. if anyone has any insight into this dilemma that would be appreciated!
XML Image Gallery Image Resize
I just got through with the XML image gallery tutorial that Kirupa made. First of all, I would like to thank him for it -- a great tutorial.
I am in the process of modifying the tutorial file to suit my needs, and I have come across a problem:
There is an empty movie clip with the instance name "image" that controls where the images from the XML flie are showed in the SWF. The empty movie clip "node" or placeholder aligns itself to the top left-hand corner of the images file. For my gallery to funciton correctly, I need the node to be aligned to the center of the image files, so I can display pictures of different aspect ratios and alignments. I will try and post a file on the internet some time today to demonstrate this if I am unclear with my explination. Thanks in advance!
XML Image Gallery Image Resize
I just got through with the XML image gallery tutorial that Kirupa made. First of all, I would like to thank him for it -- a great tutorial.
I am in the process of modifying the tutorial file to suit my needs, and I have come across a problem:
There is an empty movie clip with the instance name "image" that controls where the images from the XML flie are showed in the SWF. The empty movie clip "node" or placeholder aligns itself to the top left-hand corner of the images file. For my gallery to funciton correctly, I need the node to be aligned to the center of the image files, so I can display pictures of different aspect ratios and alignments. I will try and post a file on the internet some time today to demonstrate this if I am unclear with my explination. Thanks in advance!
V3 Gallery By Scotty
I'm trying to build up a photo gallery based in the V3 gallery made by Scotty. I'm almost done with the gallery and it's working fine, i just need to add 2 more things to the gallery but not results yet. First i would like to know if it's possible to add a "close or back" button to the main picture, so each time the user click on a thumbnail and the main picture is loaded the user can press this button and close it. My idea is to open the main picture over the thumbnails, then after the user take a look of the current picture, he could close it by pressing this "close or back button" and then go back to the thumbnails to choose another pic (hope it makes sense).
The second thing i would like to do is to add a roll over effect to the thumbnails, something like on roll over modify the alpha, or add to each of the thumbnail a sound . i been trying this but i can't figure out how to modify the AS to achieve it.
Maybe i'm asking for too much, but if anybody can help, it'll be really appreciated.
Thanks!
Help With Scotty's Gallery
Hi all,
I am hoping someone can help me with one of Scotty's galleries from this post http://www.kirupa.com/forum/showthread.php?t=87388
I was wondering if anyone has put in "next" and "back" buttons into the "V3_with_thumbs_scrolled" gallery? I have tried a few things but none work, which probably because I don't understand a couple of parts of the code. If anyone can help, it would be cool.
Thanks to anyone who gives it a shot!
Plonker
Scotty XML Gallery
This may be a dum question, but how many images can i load from a xml file into the Scotty xml gallery.
I'm only loading 33 and the infinite menu gallery stops
If anyone coul help me please
Scotty's Gallery Help
I'm trying to create an image gallery like this, http://www.noriomatsumoto.com/
but i'm not having too much luck. I'm having problems with the thumbnails, i'm trying to get them to advance 1 at a time like on that site, but I can't get it to work right.
Any suggestions or links that would help me?
Thanks
Matt
Scotty's Gallery - Configure From XML
I would like to add some variables which could be changed in the XML.
The XML part I'm fine with... it's just loading them with the action script.
Could someone please show me how I can read and implement a variable.
TIA
Scotty Gallery With Transition? Possible?
I've been searching the forum for hours but can't seem to find the solution to this problem.
I want to load the larger image in a new Movie after a transition. and unload the thumbscroller
With the example it loads in the container that is already placed.
How can this be done? It must be very easy.
I've added the file again and hope someone preferably scotty cracks it!
it has something to do with changing this of course
Quote:
item.onRelease = function() {
containerMC.loadPic(this.id);
Help Needed With Scotty's V3 Gallery
hi ...i got hold of the v3 gallery with thumbnails...basically the problem i hav is that i need a url to be launched/opened when a particular mc is selected.....the urls are stored in an xml file with the rest of the gallery info...
heres an example piece of the xml...
<image source="barbershop/big/cut1_big.jpg" thumb="barbershop/thumb/cut1_t.jpg" title="CUT1" link="http://www.google.com"/>
heres the AS im using...
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();
bar._visible = 1;
per = Math.round((l/t)*100);
bar._width = per;
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;
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.scroll.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 = scroll.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%3*70;
thb._y = Math.floor(i/3)*67;
}
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() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = scroll.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.scroll.th_nav["thmb"+i].enabled = 1;
this.scroll.th_nav["thmb"+i].box._alpha = 100;
} else {
this.scroll.th_nav["thmb"+i].enabled = 0;
this.scroll.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);
i've made various attemps...but i either get sommink like 'cannot find "_blank"... or i get directed to my index folder....
any help would be greatly appreacited...please.. thanks....
Scotty Xml Gallery With Thumbs
Hallo Guys,
I'm using the Scotty's V 3 gallery with thumbs and the V_3 Galllery with thumbs scroll, I would like to know if it's possible to add button for:
Slideshow (for Both)
Next and Previous button ( for both)
Please, let me know if it's possible...
Damiano
Preloader With Scotty's Gallery?
Can anyone show me the way to build a preloader for Scotty's XML multi gallery?
--> http://www.kirupa.com/forum/showthread.php?t=213873
Thanks.
Help Scotty, For A Little Kirupa Gallery Update..
hi,
i just finish this great tutorial :
http://www.kirupa.com/developer/mx20...otogallery.htm
it works perfectly... but i try to add a new feature to it :
adding a simple list to choose differents "theme"..
"theme" are a new XML entry.
each "theme" have a specifique list of pictures with comments ( like the original tutorial )
how do this ?
Rollover Text With Scotty's Gallery...
Hi there...
I have a problem with the rollover text using scotty's image resize gallery... I have replaced his buttons with an animated button found from a tutorial on Kirupa. I have alterered the button to work instead of the thumbnails, and everything seems to load and unload just fine... but I can't get the rollover text to appear on my new button at all, why is this happening? I have attached the .fla with an example... included is my custom animated button (with no text display) and a couple of regular buttons which display text fine.
This should be an easy fix, any help is greatly appreciated...
Gotemgreat
Scotty's V3 Gallery - Jumping Dragger
I've modified Scotty's gallery (V3 with thumbs scrolled) to hold larger thumbs (as well as other changes) and I'm having problems with the up and down buttons making the dragger scroll only halfway down and then stop. If I click and hold on the dragger to move it down starting from the top, it will jump halfway down. I've looked at the scrollbar AS and I can't find out what's wrong. But I've modified the file so much, I might have missed something.
Thanks.
Multiple Preloader For The 'scotty' Gallery
yup - yet another post on the famous XML gallery by scotty
I only found one post about this subject searching the forum, and it concers Flash MX - and I coundent quite get the code to work properly in MX 2004:
http://www.kirupa.com/forum/showthread.php?t=93050
The thing is, that I'm trying to build a multiple preloader for the gallery, so instead of the images being loaded each time the user clicks the next button - the images should start loading upon entering the gallery. So when I'm looking at the first image, I would like the others images to be loaded in "behind", so I don't have to wait on the next image to load each time..
I suck when it comes to preloaders - so if anyone could point me in the right direction, I would be very glad.
The Gallery With Multiple Galleries, Scotty?
As a graphic design student I am making an online portfolio these days. "The gallery with multiple galleries using one XML" is almost just what I need.
In this portfolio I am using the galleries inside the gallery as project galleries. Some projects are going to contain only one image. Therefore I dont need the prev/next buttons in some cases. Is there a way to atomatically disable the prev/next buttons in galleries with only one image? Is there a way to load text for the whole project gallery and not every single image? And is it someway possible to put HTML in this text? When I try, the gallery doesn´t work. It would at least be nice to be able to put links and do some basic text editing in the text field.
And at last I want to get rid of the resizing. I know that I can make the jpgs I´m loading into the gallery in one size, but its kind of messy having a lot of scripting you dont need in the document. I´ve tried tidying up the code, but I cant make it without putting everything out of order. (I know this may be silly, but I´m a tidy person )
Hope this isn´t way too much to ask for. I would be very gratefull if someone could help me out!
Extra Dynamic Txt Box In Scotty's Gallery
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?
Scotty's V3 With Thumbs Photo Gallery.
Hi guys.
I recently downloaded the amazing "V3 with thumbs mx" photo gallery fla.
I am a flash novice so excuse me if i am asking a simple question.
This photo gallery is just what i wanted, however, i am trying to change the menu options to the top left of the gallery - Gallery 1, Gallery 2, Gallery 3, Gallery 4. I am trying to change these names to Area 1, Area, 2, Area 3, Area 4.
When i double-click on say Gallery 1, i am taken into the movie clip, but from here i am not able to change Gallery 1 to Area 1??? Can someone please advise as to how the Gallery 1 text can be changed???
Much appreciated.
Questoin About Scotty's Infinite Photo Gallery
Hi, I downloaded one of Scotty's great things (file name : Infinite_dynamic_mx) and tried to understand how to do it. Here is my first question which is about the preloader. Correct me from wrong, the green bar is to show the loading progress of the thumbnails, then how comes the thumbnails showed before the green bar finished loading.
HELP - Applying Rollovers To Scotty's Gallery Thumbs...
I have been tryin to correctly apply a rollover and rollout to a modified vs. of "vs3 with thumbs" by Scotty found on this forum.
I'm trying to have them rollover to an _alpha of 100 and then rollOut to 50 which is what they are originally set at. I don't know what I'm doing wrong but when I rollover it stay's at 50 and when I rollOut it goes to 25%! Very frustrating - I've tried adjusting a ton of different things and still no solution!
Such a simple task turns out to be a nightmare to try and figure out. It's been 3 days and I can't figure this out so HOPEFULLY someone here can help.
Here is my files if someone could take a quick look - http://thesavager.com/12oz/gallery.zip
and below is my AS...
Thanks so much in advance!!!
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.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 = th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%2*78;
thb._y = Math.floor(i/2)*78;
}
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);
}
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 = 50;
this.th_nav["thmb"+i].onRollOver = function() {
this._alpha = 100;
//this.alphaTo(100, 0.2, "linear");
}
this.th_nav["thmb"+i].onRollOut = function(){
this._alpha = 50;
//this.alphaTo(50, 0.2, "linear");
}
}
else {
this.th_nav["thmb"+i].enabled = 0;
this.th_nav["thmb"+i].box._alpha = 100;
}
}
}
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);
Changing Thumb Size With Scotty's Gallery Files
Hi, I'm new here and I've done a search to see if this issue has been covered before, but I didn't find anything.
I'm working with "V3_thmbs_scrll_btn.fla", one of Scotty's image gallery files, and I'm wanting to change the thumb size from 40px to 60px. I've editied the thumb and thumbs_nav MCs to be 62x62px (with some padding for the new thumbs, since they were 44px before) and the thumbnails are messed up. They are stacked partway on top of each other, and changing the size of the textScroller and theMask MC to 200px (so three thumbs can be in a row) doesn't seem to help things much.
I did notice that the AS uses some code like this:
Code:
thb._x = i%3*50;
thb._y = Math.floor(i/3)*50;
I've played around with deleting and changing things and realize that that snippet of code modifies things as well, but I don't know enough yet to figure out what thb._x and thb._y does, except that they are related to the thumbnail buttons.
In summary, I'm changing the size of my thumbnails to 60px vs. 40px, and I'd can't figure out how to get them to line up nicely like they did when using the 40px thumbs. I've attached a screenshot of what I'm seeing to help out.
Thanks for your time.
Fade Out Image (Scotty's Example)
Using an example that Scotty previously posted:
Scotty's Code (The attached example uses the same code but fades in an image)
When a thumb is clicked, the image fades in. I'm having trouble fading out the current image when another thumbnail is pressed?
If I call a fadeOut function when a thumbnail is clicked, this refers to the image being loaded. How can I get the previous image to fade out before the next image fades in?
Thanks
Fade Out Image (Scotty's Example)
Using an example that Scotty previously posted:
Scotty's Code (The attached example uses the same code but fades in an image)
When a thumb is clicked, the image fades in. I'm having trouble fading out the current image when another thumbnail is pressed?
If I call a fadeOut function when a thumbnail is clicked, this refers to the image being loaded. How can I get the previous image to fade out before the next image fades in?
Thanks
Scotty's Image Interface W/ Preloader...
So I have slightly altered Scotty's V3_MX gallery coding so that it works with a sliding row of thumbnails. Everything's fine, until I add my preloader.
The coding for the preloader is
ActionScript Code:
bytes_loaded = Math.round(this.getBytesLoaded());bytes_total = Math.round(this.getBytesTotal());getPercent = bytes_loaded/bytes_total;this.loader_mc._height = getPercent*100;this.loaded_txt.text = Math.round(getPercent*100)+"% Loaded";if (bytes_loaded == bytes_total) { this.gotoAndPlay(3);
When I do this, it loads the thumbnails, but returns nothing when I click on them. The main difference I can think of is that somehow moving the content for the gallery and the code to frame 3 has somehow screwed it up a bit...
My .fla can be downloaded from www.mentalfabrications.com/storage/gallery.zip
Any help would be greatly appreciated.
Thanks,
iLan
Scotty's Image Interface W/ Preloader...
So I have slightly altered Scotty's V3_MX gallery coding so that it works with a sliding row of thumbnails. Everything's fine, until I add my preloader.
The coding for the preloader is
ActionScript Code:
bytes_loaded = Math.round(this.getBytesLoaded());bytes_total = Math.round(this.getBytesTotal());getPercent = bytes_loaded/bytes_total;this.loader_mc._height = getPercent*100;this.loaded_txt.text = Math.round(getPercent*100)+"% Loaded";if (bytes_loaded == bytes_total) { this.gotoAndPlay(3);
When I do this, it loads the thumbnails, but returns nothing when I click on them. The main difference I can think of is that somehow moving the content for the gallery and the code to frame 3 has somehow screwed it up a bit...
My .fla can be downloaded from www.mentalfabrications.com/storage/gallery.zip
Any help would be greatly appreciated.
Thanks,
iLan
Scottys Resize Gallery The Gallery With Thumbnails And Multiple Galleries Problem
Hi all,
I'm relatively new to flash and was looking through the forums and found Scottys cool resize gallery which i am trying to implement in a dreamweaver website.
This is probably a stupid question but i was wondering if anyone could tell me how to add in a fifth gallery to the program - i'm probabaly doing something stupid but i can't seem to access the actions panel at all to look through the code??
Any help would be greatly appreciated!!
Also, does anyone know if this gallery will take forever to load onto a webpage or will it load relatively quickly!??
Thanks a mil in advance
Derm
Resize Bg On Browser Resize While Maintaining Image Proporti
im using the following code to resize background images on browser resize:
Code:
var listener:Object = new Object()
bg_mc.width = Stage.width;
bg_mc.height = Stage.height;
listener.onResize = function(){
bg_mc.width = Stage.width;
bg_mc.height = Stage.height;
}
Stage.addListener(listener);
the problem i'm having is that my background image does not maintain proportion on resize. so, when i resize my browser to a width of 100px, the entire width of my background image is compressed into the 100px area.
is there some additional code i can add to the snippet above to maintain the proportions of my background image on resize?
thanks,
brandon
Resize Gallery
hello im trying to make this same gallery like this site.
http://www.carolacord.com/
click on the editorial section so u can see how the white square resizes to the image. thats what i want but instead of typing on the arrow key. to be with butons. thanks.
a very common effect but i can't find a tutorial or fla anywhere so if someone could help me showing me a tutorial or a fla it would be great .
Thanks.
|