Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Xml Image Gallery Trouble



I'm trying to create an xml image gallery at the moment. I've made it so it works but I'm now cleaning the code and I want to separate the navigation into a class of its own. Here is the Gallery class...
ActionScript Code:
package _classes{    import flash.display.Sprite;    import flash.display.Stage;    import flash.display.StageAlign;    import flash.display.StageScaleMode;    import flash.net.URLLoader;    import flash.net.URLRequest;    import flash.events.Event;    import _classes.media.displays.ImageDisplay;    import _classes.media.controllers.ImageController;    public class Gallery extends Sprite {        private var _xmlLoader:URLLoader = new URLLoader();        private var _xmlData:XML;        public var pImageList:XMLList;        public function Gallery() {            initStage();            loadContent();        }                private function loadContent():void {            _xmlLoader.addEventListener(Event.COMPLETE, onContentLoaded);            _xmlLoader.load(new URLRequest("gallery.xml"));        }                private function initStage():void {            stage.frameRate = 61;            stage.scaleMode = StageScaleMode.NO_SCALE;            stage.align = StageAlign.TOP_LEFT;        }                private function onContentLoaded(event:Event):void {            _xmlData = _xmlData = new XML(event.target.data);            pImageList = _xmlData.image.imagePath;            initController();        }                private function initController():void {            var imageController:ImageController = new ImageController(pImageList);            addChild(imageController);        }    }}
ImageController class
ActionScript Code:
package _classes.media.controllers{    import flash.display.Sprite;    import flash.events.MouseEvent;    import _classes.media.displays.ImageDisplay;    public class ImageController extends Sprite {        private var _imageCurrPos:Number = 1;        public function ImageController(pImageList:XMLList) {                        var navBack:NavBack = new NavBack();            addChild(navBack);            navBack.x = 0;            navBack.y = 373;            var prevButton:PrevButton = new PrevButton();            addChild(prevButton);            prevButton.x = 0;            prevButton.y = 373;            prevButton.addEventListener(MouseEvent.MOUSE_DOWN, previousClick);            var nextButton:NextButton = new NextButton();            addChild(nextButton);            nextButton.x = stage.stageWidth - nextButton.width;            nextButton.y = 373;            nextButton.addEventListener(MouseEvent.MOUSE_DOWN, nextClick);            var navContainer:Sprite = new Sprite();            addChild(navContainer);            navContainer.y = 374;            for (var i:uint = 1; i <pImageList.length() + 1; i++) {                var imageElement:XML = pImageList[i];                var button:ImageButton = new ImageButton();                navContainer.addChild(button);                button.addEventListener(MouseEvent.MOUSE_DOWN, onMouseClick);                button.x = i * 18;                button.useHandCursor = true;                button.buttonText.text = String(i);            }            navContainer.x = stage.stageWidth - (navContainer.width + prevButton.width + 20);            function onMouseClick(event:MouseEvent):void {                var image:ImageDisplay = new ImageDisplay(pImageList[(event.target.text) - 1]);                addChild(image);                _imageCurrPos = Number(event.target.text);                trace(_imageCurrPos);            }            function previousClick(event:MouseEvent):void {                var image:ImageDisplay = new ImageDisplay(pImageList[_imageCurrPos - 1]);                addChild(image);                _imageCurrPos = _imageCurrPos - 1;                trace(_imageCurrPos);            }            function nextClick(event:MouseEvent):void {                var image:ImageDisplay = new ImageDisplay(pImageList[_imageCurrPos + 1]);                addChild(image);                _imageCurrPos = _imageCurrPos + 1;                trace(_imageCurrPos);            }        }    }}
I'm trying to pass a public XMLList variable from the gallery to the controller and I get this error...
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at _classes.media.controllers::ImageController$iinit() at _classes::Gallery/::initController() at _classes::Gallery/::onContentLoaded() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Any help would be greatly appreciated...David



KirupaForum > Flash > ActionScript 3.0
Posted on: 09-10-2007, 06:24 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[CS3] Sliding Image Gallery Trouble
Hi,

I'm trying to create an sliding image gallery with ease like this: http://www.webdesign.org/web/flash-&...ing.12433.html but I would like to have only two arrow buttons back and forward but still remain the same kind of sliding with ease- function that the example has. Could someone give me a hand on how modify the code to get it work with only those two buttons?

Cheers,
Satu

Thumbnail Trouble, Image Gallery, Xml.
Hi, I'm making an image gallery and are having some issues with the thumbnails.

What I want is to be able to have thumbnails with the same height but different width.



Attached the fla.

Variable Trouble For Autommated Image Gallery
I am having a really hard time trying to set the following variable.

i have a bunch of loaded variables via an ASP page. It outputs the filenames of the number of files kept in the 'images' folder at the time the page is loaded.
it outputs the filenames setting each variable with the names:

image1=xxx.jpg&image2=xyz.jpg&image3=jkl.jpg.

i have successfully created buttons corresponding to the number of images conatined in my folder. I now need to figure out how i can set

photo = myData.image+i (this is value of the filename of my image)

this is for use in the same loop which creates buttons automatically.

The idea is that if it loops through the values of image1 etc the value, which is the full name of the file will be addedaccordingly.

here is my code :


myData = new LoadVars();

myData.onLoad = function() {







image5.text= myData.image5;
filepath = "http://123.123.123/FLASHASP/images/";
numButtons = myData.imagecount;
X = 10;
Y = 10;
for (i=1; i<=numButtons; ++i) {

_root.attachMovie("button", "button"+i, i);
buttons[i] = _root["button"+i];
_root["button"+i].index = i;
_root["button"+i].num = i;
_root["button"+i]._x = (i*X)*4;
_root["button"+i]._y = 20;
_root["button"+i].onPress = function () {
_root.createEmptyMovieClip("container",300);
mydatavalue = myData.image+[i];
container.loadMovie(filepath+mydatavalue, "container");
container._x =200;
container._y = 50;
}
}
}

myData.load("default.asp");


If Anyone can help out here, I will be very greatful and will definitely shar the fruits when i turn it into a component!!!!!

Trouble With Flash Image Gallery And Thumbnails
I originally tried to make this photopage work in flash6, but I just upgraded to 8 and I still cannot get it working. The normal photo window and buttons work fine, but the thumbnails fail to show up at all. I have gone through Kirupa's awesome tutorials to get to this point, but I just cannot get my head around why the thumbnails are just completely failing for me. Would someone mind grabbing my .fla and trying to find what mistake I have made. I am completely at a loss ;;. Thanks.

http://www.levelforge.planetquake.ga...dailyphoto.zip

Variable Trouble For Autommated Image Gallery
I am having a really hard time trying to set the following variable.

i have a bunch of loaded variables via an ASP page. It outputs the filenames of the number of files kept in the 'images' folder at the time the page is loaded.
it outputs the filenames setting each variable with the names:

image1=xxx.jpg&image2=xyz.jpg&image3=jkl.jpg.

i have successfully created buttons corresponding to the number of images conatined in my folder. I now need to figure out how i can set

photo = myData.image+i (this is value of the filename of my image)

this is for use in the same loop which creates buttons automatically.

The idea is that if it loops through the values of image1 etc the value, which is the full name of the file will be addedaccordingly.

here is my code :


myData = new LoadVars();

myData.onLoad = function() {







image5.text= myData.image5;
filepath = "http://123.123.123/FLASHASP/images/";
numButtons = myData.imagecount;
X = 10;
Y = 10;
for (i=1; i<=numButtons; ++i) {

_root.attachMovie("button", "button"+i, i);
buttons[i] = _root["button"+i];
_root["button"+i].index = i;
_root["button"+i].num = i;
_root["button"+i]._x = (i*X)*4;
_root["button"+i]._y = 20;
_root["button"+i].onPress = function () {
_root.createEmptyMovieClip("container",300);
mydatavalue = myData.image+[i];
container.loadMovie(filepath+mydatavalue, "container");
container._x =200;
container._y = 50;
}
}
}

myData.load("default.asp");


If Anyone can help out here, I will be very greatful and will definitely shar the fruits when i turn it into a component!!!!!

This Is A Fix To The Image Gallery Tutorial - Makes It A Fully Dynamic Gallery
After searching and reading a couple of hundred post on the truly GREAT Kirupa image gallery tutorial - and wondering why nobody has written a new tutorial or at least updated the "old" one to avoid overloading the net with flash image gallery questions.

Im trying to create a new thread that will serve as a basic startingpoint for all Kirupa gallery questions. Im no überscripter nor do I know a lot about flash, but with a little common sense and perhaps some help from all of you... oh well - here goes:

Quick Checklist:

If your JPG's wont load - Make sure you don't save them as progressive JPG's, as they wont load in Flash.
If your images dont align to the photo container movieclip it is probably because your registration point of the photo MC is set to center instead of topleft.
Below is the code I have pieced together from different posts on the subject (I would like to credit all the authors, but that would require me reading all the posts again, as I have forgotten where I got them.

It produces a gallery that loads files dynamicaly thru a phpscript and checks for maximum image height/width and scales the images to fit within the photo MC. It also sets the center of the displayed images to a given coordinate (x,y).

All in all this is a install and forget image gallery, where the only maintaining required is uploading new pictures to the image folder.

On the server the file/directory structure is:
gallery swf
filearray.php
images/file_x.jpg
file_y.jpg
etc...

This is the filearray.php - modify this to check for files in the path set in the actionscript line: this.pathToPics = "images/";


PHP Code:



  <?php  if ($dir = opendir("images")) {    while (($file = readdir($dir)) !== false) {          $cont++;      if ($file == "." || $file == "..") { } else {              $string.= ($file);          $string.= "&";          }        }      closedir($dir);  }  print($string);  ?>





This is the modified actionscript from the original Kirupa gallery script:


ActionScript Code:
// This loads the array created by filearray.php and puts it into pArray   lv = new LoadVars();  lv.load("filearray.php");  lv.onData = function(text){  pArray = text.split("&");  for (i=0; i<pArray.length-1; i++) {  trace(pArray[i]);  }  }    // variables ------------------------------------------  // put the path to your pics here, include the slashes (ie. "pics/")  // leave it blank if they're in the same directory  this.pathToPics = "images/";  // fill this array with your pics (set from filearray.php)  this.pArray = pArray;            this.fadeSpeed = 20;  this.pIndex = 0;    // MovieClip methods ----------------------------------  // d=direction; should 1 or -1 but can be any number  //loads an image automatically when you run animation  loadMovie(this.pathToPics+this.pArray[0], _root.photo);    // Center the photo at (x,y) the coordinates are set in line 69  MovieClip.prototype.centered = function(x, y) {  this._x = x-this._width/2;  this._y = y-this._height/2;  };  // Makes sure that the image fits within (wMax, hMax)  MovieClip.prototype.resize = function(wMax, hMax) {  while (this._width>wMax || this._height>hMax) {  this._xscale = this._yscale -= 1;  }  };  // This line sets max width and max height (wMax, hMax)  photo.resize(397, 297);    MovieClip.prototype.changePhoto = function(d) {      // make sure pIndex falls within pArray.length      this.pIndex = (this.pIndex+d)%this.pArray.length;      if (this.pIndex<0) {          this.pIndex += this.pArray.length;      }      this.onEnterFrame = fadeOut;  };  MovieClip.prototype.fadeOut = function() {      if (this.photo._alpha>this.fadeSpeed) {          this.photo._alpha -= this.fadeSpeed;      } else {          this.loadPhoto();      }  };  MovieClip.prototype.loadPhoto = function() {      // specify the movieclip to load images into      var p = _root.photo;      //------------------------------------------      p._alpha = 0;      p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);      this.onEnterFrame = loadMeter;  };  MovieClip.prototype.loadMeter = function() {      var i, l, t;      l = this.photo.getBytesLoaded();      t = this.photo.getBytesTotal();      if (t>0 && t == l) {          this.onEnterFrame = fadeIn;          // This line sets the (x,y) center of the image on the stage          this.photo.centered(249, 213);      } else {          trace(l/t);      }  };  MovieClip.prototype.fadeIn = function() {      if (this.photo._alpha<100-this.fadeSpeed) {          this.photo._alpha += this.fadeSpeed;      } else {          this.photo._alpha = 100;          this.onEnterFrame = null;      }  };


This should do it - the only thing I (think) I need some help with is changing the script to actually load the FIRST image, when the gallery loads. For some reason beyond my knowledge you have to click the next button for a image to load... What part of the script needs to be changed to make sure that a image is loaded on startup???

I hope someone will take the time to help develope this gallery tutorial / help file... It would be great if you added som more steps to the quick checklist... and of course fixed the load image on start problem....

This Is A Fix To The Image Gallery Tutorial - Makes It A Fully Dynamic Gallery
After searching and reading a couple of hundred post on the truly GREAT Kirupa image gallery tutorial - and wondering why nobody has written a new tutorial or at least updated the "old" one to avoid overloading the net with flash image gallery questions.

Im trying to create a new thread that will serve as a basic startingpoint for all Kirupa gallery questions. Im no überscripter nor do I know a lot about flash, but with a little common sense and perhaps some help from all of you... oh well - here goes:

Quick Checklist:

If your JPG's wont load - Make sure you don't save them as progressive JPG's, as they wont load in Flash.
If your images dont align to the photo container movieclip it is probably because your registration point of the photo MC is set to center instead of topleft.
Below is the code I have pieced together from different posts on the subject (I would like to credit all the authors, but that would require me reading all the posts again, as I have forgotten where I got them.

It produces a gallery that loads files dynamicaly thru a phpscript and checks for maximum image height/width and scales the images to fit within the photo MC. It also sets the center of the displayed images to a given coordinate (x,y).

All in all this is a install and forget image gallery, where the only maintaining required is uploading new pictures to the image folder.

On the server the file/directory structure is:
gallery swf
filearray.php
images/file_x.jpg
file_y.jpg
etc...

This is the filearray.php - modify this to check for files in the path set in the actionscript line: this.pathToPics = "images/";


PHP Code:



  <?php  if ($dir = opendir("images")) {    while (($file = readdir($dir)) !== false) {          $cont++;      if ($file == "." || $file == "..") { } else {              $string.= ($file);          $string.= "&";          }        }      closedir($dir);  }  print($string);  ?>





This is the modified actionscript from the original Kirupa gallery script:


ActionScript Code:
// This loads the array created by filearray.php and puts it into pArray   lv = new LoadVars();  lv.load("filearray.php");  lv.onData = function(text){  pArray = text.split("&");  for (i=0; i<pArray.length-1; i++) {  trace(pArray[i]);  }  }    // variables ------------------------------------------  // put the path to your pics here, include the slashes (ie. "pics/")  // leave it blank if they're in the same directory  this.pathToPics = "images/";  // fill this array with your pics (set from filearray.php)  this.pArray = pArray;            this.fadeSpeed = 20;  this.pIndex = 0;    // MovieClip methods ----------------------------------  // d=direction; should 1 or -1 but can be any number  //loads an image automatically when you run animation  loadMovie(this.pathToPics+this.pArray[0], _root.photo);    // Center the photo at (x,y) the coordinates are set in line 69  MovieClip.prototype.centered = function(x, y) {  this._x = x-this._width/2;  this._y = y-this._height/2;  };  // Makes sure that the image fits within (wMax, hMax)  MovieClip.prototype.resize = function(wMax, hMax) {  while (this._width>wMax || this._height>hMax) {  this._xscale = this._yscale -= 1;  }  };  // This line sets max width and max height (wMax, hMax)  photo.resize(397, 297);    MovieClip.prototype.changePhoto = function(d) {      // make sure pIndex falls within pArray.length      this.pIndex = (this.pIndex+d)%this.pArray.length;      if (this.pIndex<0) {          this.pIndex += this.pArray.length;      }      this.onEnterFrame = fadeOut;  };  MovieClip.prototype.fadeOut = function() {      if (this.photo._alpha>this.fadeSpeed) {          this.photo._alpha -= this.fadeSpeed;      } else {          this.loadPhoto();      }  };  MovieClip.prototype.loadPhoto = function() {      // specify the movieclip to load images into      var p = _root.photo;      //------------------------------------------      p._alpha = 0;      p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);      this.onEnterFrame = loadMeter;  };  MovieClip.prototype.loadMeter = function() {      var i, l, t;      l = this.photo.getBytesLoaded();      t = this.photo.getBytesTotal();      if (t>0 && t == l) {          this.onEnterFrame = fadeIn;          // This line sets the (x,y) center of the image on the stage          this.photo.centered(249, 213);      } else {          trace(l/t);      }  };  MovieClip.prototype.fadeIn = function() {      if (this.photo._alpha<100-this.fadeSpeed) {          this.photo._alpha += this.fadeSpeed;      } else {          this.photo._alpha = 100;          this.onEnterFrame = null;      }  };


This should do it - the only thing I (think) I need some help with is changing the script to actually load the FIRST image, when the gallery loads. For some reason beyond my knowledge you have to click the next button for a image to load... What part of the script needs to be changed to make sure that a image is loaded on startup???

I hope someone will take the time to help develope this gallery tutorial / help file... It would be great if you added som more steps to the quick checklist... and of course fixed the load image on start problem....

Movie/anim Gallery? (not Image Gallery)
Ive come across this gallery and preloader

http://www.flashkit.com/movies/Scrip...7797/index.php

I love the way I can just dump my images in a folder and with a few tweaks it will put these images in the gallery.

What I am looking at is a way to do this with seperate .swf animations.

What I want to be able to do is dump a number of linear animation swf files into a folder, then when I launch the gallery, the first animation plays, and when it reaches the end it automatically plays the next animation in the folder. Then I want the whole thing to loop.

Any ideas?

XML Gallery - Generate XML Path For Image Gallery
I learned from great tutorial of kirupa .
I tried to create own image gallery, now I stay in front of problem.
How can I generate path for my images and thumbnails for XML file.
E.g. I have 110 images paths and 110 thumbnails path.
Manually takes it lot of time , how can I make this code for XML file?


<pic>
<image>images/img/ref/img/img_001.jpg</image>
<thumbnail>images/img/ref/thm/img_001.jpg</thumbnail>
</pic>

next node, next node,
...
last node:

<pic>
<image>images/img/ref/img/img_110.jpg</image>
<thumbnail>images/img/ref/thm/img_110.jpg</thumbnail>
</pic>

Product Gallery, Image Gallery Or Portfolio..
Hi! This is probably insanely much to ask for but I do it anyway This is for us designers that want to learn some action script to help us show some xml driven data in our flash projects.

I’ve been searching the web for tutorials that can help me with a specific project that I want to develop. I’ve found a bounce of things that is close to what I’m looking for but not right on the spot. And I think that there are many out there that are looking for the same tutorial as I am. For me the best way to learn is to deconstruct example files with code hints. So if any of you flash gurus out there could help us with an example .Fla for this project I think many would be very happy!

The project:
I want to create a gallery of “what ever”. It could be a product gallery, image gallery or a portfolio. This can be used for many things. I’ve attached an image (template.jpg) that pretty much explains what I’m looking for. I also included an example of how the xml file could look like.

I think this could be an excellent example for many designers/developers that are new to dealing with xml, images and flash.

Jpeg Gallery Help: Slow Loading + Trouble With Loading Gallery Swf Into Other Swf
HI (PC MX2004)

I am using the code below to load dynamically load jpegs into the swf. I am then loading that swf into another swf using loadMovie on a button. I have two unavoidable problems. Firstly when I click a button to load the swf all I get is the 'loading' text. then I click a different button for a different swf gallery and those images work fine. Then I click back on the first button and the images. I have attached a test file to illistrate this.

Secondly with the code below, the jpegs are fine up to about 7/8 then it slows down. I need to be able to have up to 25 images in each gallery. Is it something in the code or am I better off changing to an xml gallery? Much appreciated

link to show patheticness of transitions is http://www.louisasloan.com/gallery/drawings.html




Code:
code: //on layer called var//

var totalNumPics=1;
var maxDepth=1000;
var cpicnum=0;
var xi=50;
var yi=20;
var btnWidth=25;
var path="pics/1image";
var currentpic=0;



//on layer called functions//


function fadeout() {
if (this._alpha<0) {
this.onEnterFrame = undefined;
} else {
this._alpha -= 15;
}
}
function fadein() {
if (this._alpha>95) {
this.onEnterFrame = undefined;
} else {
this._alpha += 15;
}
}
function loadNextPic() {
if (_root.cpicnum<_root.totalNumPics) {
var pic_mcl = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
trace(target+".onLoadProgress with "+bytesLoaded+" bytes of "+bytesTotal);
_root.percent = int(bytesLoaded*100/bytesTotal);
};
listener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number) {
_root.percent = "Done!";
var param = {_x:(_root.xi+_root.cpicnum*_root.btnWidth), _y:_root.yi};
var temp = _root.attachMovie("btn", "btn"+_root.cpicnum, _root.getNextHighestDepth(), param);
temp.num = _root.cpicnum+1;
if (_root.cpicnum == 0) {
_root["picHolder"+_root.cpicnum].onEnterFrame = _root.fadein;
}
_root.cpicnum++;
loadNextPic();
};
var temp = _root.attachMovie("picHolder", "picHolder"+cpicnum, maxDepth--, {_alpha:0, _x:50, _y:50});
pic_mcl.loadClip(_root.path+_root.cpicnum+".jpg", temp);
pic_mcl.addListener(listener);
}
}
loadNextPic();
// I added the below code to solve previous problem of loaded swf taking charge stage and emptying all other swfs. i am not sure if that is correct terminology but it fixed problem somehow on stage
this._lockroot = true;

Kirupa Picture Gallery / Keeping The Image On Stage As New Image Loads
Hi, I have the Kirupa Image Gallery implemented and it works great. But I was wondering how I can go about having the image stay on screen as it is loading the next image, so it's not such an abrupt transition. Currently the image container goes blank as it loads the next image. I assume I will need another image movieclip that sits underneath the first one... but then what?

Thanks!

Simple Gallery Example Flash With PHP Serving Image List And Image Sizes
this is simple gallery example for AS2
gallery is nothing special ease to use and implement

interesting thing about this example is that you pass a folder, and PHP side gathers images list from folder and returns it to Flash in XML form together with images widths and height which makes it more easier to implement this sort of galleries like I've made

example : http://www.hagane.us/as/gallery/
ZIP : http://www.hagane.us/as/gallery/gallery.zip

blogpost : http://mrsteel.wordpress.com/2008/01...s-from-folder/

Seeking Flash Image Gallery That Resizes Movie To Fit Image Dimensions
I am looking for a flash gallery that resizes the movie dimensions to fit the width and height of the image in real-time. Alternatively, the movie does not display a background color or border. I've used slideshowpro and it's feasible ...just looking for another suggestion. Prefer xml-based.

Image Streching For Unknown Reason In Dynamic Image Gallery
Hi everyone, this is my first time using flash.

I followed a tutorial at http://www.lukamaras.com/tutorials/a...e-gallery.html and everything is working okay, except when I view the big images they are 4x wider than they should be, stretching to the right. I think its a problem with action script maybe because I'm using cs3, and saving the file as flash 8? I'm not sure. I've included the file and the xml/photos it references in case anyone is nice enough to check out my problem.

http://www.mediafire.com/?euw1wywgnvg

Thanks! -mike

Actionscript Image Gallery > Updating Thumbnail And Main Image
Hi all,

I'm helping a friend produce a small Flash website. For some artwork/photos.

Basically a strip of thumbnail images at the bottom, clicking a thumbnail will load the (fullsize) image above.

Currently ten thumbnails scroll across.

**The problem**

.. is he wants to be able to drop a thumbnail image and the corresponding fullsize image into a folder on the server. The Movie should then display the latest additions. I can produce a simple slideshow where extra images are loaded at run-time (MX introduced this). But am trying to figure out how to update both the thumbnail strip and the main image.

Any help/pointers greatly appreciated.

Robert

XML Gallery: Preload On Current Image/cross-fade Image
Hello,
I am new to action script but I am learning quickly.

I took the following tutorials and made a hybrid:
Photo Gallery Using XML and Flash
Photo Slideshow Using XML and Flash


I redesigned the interface and created this:
http://www.onarresdesign.com/greg/work2.html

Everything works great, but now I want to take it further than the tutorial.
I am trying to make the images cross-fade. I am open to any suggestions and I have tried many techniques with little success.

Here is the closest solution steps I have come up with:

Code:
1) First image preloads (grey background showing)
2) First image loaded into top level MC 1
3) First image fades in
4) First image in top level MC 1 remains visible
5) First image gets loaded into bottom level MC 2 behind current movie clip.
6) Top level MC 1 clears because its preloading next image
Bottom level MC 2 remains visible
7) Preloader shows on top of bottom level MC 2
8) Next image is loaded into top level MC 1
9) Next image fades in (cross-fade effect achieved because previous image is behind it)
10) Next image gets loaded into bottom level MC 2
Repeat process
I can't get the action script to do what I want. I have off set the moveclips to show that the images are loading into both movieclips. I currently have the 'nextImage()' function controlling this so it is understandable the both images are cleared because the function is loading new images into the movie clips at the same time. How do I get one movie clip to remain constant while the other is loading? It seems to be a matter of where the function is placed. Or so I think.

I would appreciate any help I can get on this. If would also appreciate any suggestions for making the code for the control buttons cleaner.

Thank you,
</asla>

Rollover Image Gallery With Swap Image Effect?
I'm trying to do a flash banner like the one from:

http://www.eyeblaster.com/

when you rollover the buttons that say: eyeblaster ACM v2.0, advanced analytics, etc. the nice artistic banner appears. when you are no longer over it, it still stays to that same banner until you rollover the other buttons. so it's like a swap image effect, only in flash.

how would i go about this?

Photo Gallery Rollover Image Image Swap
I am using the XML Photo Gallery with thumbnails, and i have managed to modify it to suit my needs for the most part. However, some of the work i want to use it to display is photo restoration and i would like to be able to rollover the image and have a different image show on rollover. Something like you see here...http://homepage.mac.com/gapodaca/digital/bikini/ only using the XML Photo Gallery.

Any ideas?

XML Photo Gallery Trouble
I've got xml photo gallery which you can see at www.suziklinik.cz under the "Galerie".
Everything works pretty fine until I update the xml code with more then 5 albums. When I do that....for ex. I choose "album 2 or 3" and then I choose thumb/picture 1st or 2nd it always jumps to last album...why?
Please help guys
here is the flash code

Code:
this._lockroot = true;



// SETTING VARIABLES
currentpage = 1;
_global.whichalbum = 1;



//////////////////////////////////
function scalerf(w,h)
{
diffw = (w-bigframew);
diffh = (h-bigframeh);

if(diffw<=0&&diffh<=0)
{
scaler = 1 * 100;
}
else if (diffw==Math.max(diffw,diffh)) //scale to height
{
scaler = (bigframew/w) * 100;
}
else if (diffh==Math.max(diffw,diffh)) //scale to width
{
scaler = (bigframeh/h) * 100;
}
return scaler;
}

//LOADCLIP ACTIVITIES
_root.createEmptyMovieClip("looploop",-1000);
var my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadStart = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
}
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
///////////////////////////////////
// FOR PRELOADER PURPOSES
loaded = loadedBytes;
total = totalBytes;
percentage = Math.round(100*(loaded/total));
progressbar_mc.progresser_mc._xscale = percentage;
}
myListener.onLoadComplete = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
imageframe_mc.hold._alpha=0;
velo = 0;
imageframe_mc.hold.onEnterFrame = function()
{
w = imageframe_mc.hold._width;
h = imageframe_mc.hold._height;
if(w!=0&&h!=0)
{
scaler = scalerf(w,h);
if(scaler!=100)
{
imageframe_mc.hold._xscale = scaler;
imageframe_mc.hold._yscale = scaler;
}
imageframe_mc.hold._x = (bigframew - (w*(scaler/100)))/2;
imageframe_mc.hold._y = -1+(bigframeh - (h*(scaler/100)))/2;


if(imageframe_mc.hold._alpha<100)
{
accel = 0.3;
velo = velo + accel;
imageframe_mc.hold._alpha +=velo;

}

}
}
}


myListener.onLoadInit = function (target_mc)
{
//target_mc._width = 100;
//target_mc._width = 100;
}
myListener.onLoadError = function (target_mc, errorCode)
{
}
my_mcl.addListener(myListener);


/////////////////////////////////////
// XML PARSING
function imageListLoaded(whichalbum) {
//clear stage
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}


//parameters
param = this.imageList_xml.firstChild.firstChild;
pc = int(param.attributes.noofcolumn);
pr = int(param.attributes.noofrow);
ptx = int(param.attributes.thumbxs);
pty = int(param.attributes.thumbys);
_global.ptw = int(param.attributes.thumbwidth);
_global.ptl = int(param.attributes.thumbheight);
_global.bigframew = int(param.attributes.bigframewidth);
_global.bigframeh = int(param.attributes.bigframeheight);
albumnamesx = int(param.attributes.albumnamesxs);
albumnamesy = int(param.attributes.albumnamesys);
albumnamescolor = param.attributes.albumnamescolor;
////////////////////////////////////////
var albumCountXML = this.imageList_xml.firstChild.childNodes;
albumCount = albumCountXML.length - 1;

var mainNode = this.imageList_xml.firstChild.childNodes[whichalbum].firstChild;
var listBoxData = createResourceList (mainNode.childNodes,pc,pr,ptx,pty,ptw,ptl);
////////////////////////////////////
// Number of Album
albumtextbox.text = "Album "+whichalbum+">>>";
albumtextbox.background = true;
albumtextbox.backgroundColor = 0xF0CC64;
for (t=1;t<=albumCount;t++)
{

category.text = "A L B U M Y";
//category.background = true;
category.backgroundColor = 0xF0CC64;
////////////////////////////////////
//Creating text box

this.createEmptyMovieClip("albumnames"+t,900+t);
albumname_mc = this["albumnames"+t];
albumname_mc.createTextField("albumnametxt"+t,1000+t,0,0,200,200);
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = albumnamescolor;
my_fmt.font = "Tahoma"
my_fmt.size = 11;
albumname_mc["albumnametxt"+t].text = this.imageList_xml.firstChild.childNodes[t].attributes.albumname;
albumname_mc["albumnametxt"+t].setTextFormat(my_fmt);
albumname_mc._x = albumnamesx;
albumname_mc._y = albumnamesy + t * 15;
albumname_mc.sett = t;
albumname_mc.onRelease = function()
{
currentpage = 1;
filename.text = "";
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}
imageListLoaded(this.sett)
_global.whichalbum = this.sett;
}
}


}


function createResourceList(resource_array,noofcolumn,noofrow,thumbxs,thumbys,thumbwidth,thumblength,bigimagewidth) {
_global.noofcolumn = noofcolumn;
_global.noofrow = noofrow;
var listData = new DataProviderClass ();
resourceCount = resource_array.length;
noofpage = Math.ceil(resourceCount/(noofcolumn*noofrow));
ofof.text = "strana: "+currentpage+"/"+noofpage;
ofof.background = true;
ofof.backgroundColor = 0xF0CC64;
var resource, image, tmb;
images = new Array();
infotexts = new Array();

pageindex =((currentpage-1) * noofrow * noofcolumn);

for (var r = 0; r < noofrow; r++)
{

for (var c = 0; c < noofcolumn; c++) {
i = (r * noofcolumn) + c + pageindex;

if(i<resourceCount)
{
nodigits = new String(resourceCount);
resource = resource_array[i];
images[i] = resource.attributes.imagename;
infotexts[i] = resource.attributes.infotext;
loadme = "flashimg/thmb/"+images[i];
findme = images[i];
whichframe = "frame"+i;
this.attachMovie("thumbframe","thumbframe"+i,i+1);
this["thumbframe"+i]._x = (c * thumbwidth)+thumbxs;
this["thumbframe"+i]._y = (r * thumblength)+thumbys;
createEmptyMovieClip("thumbframein_mc"+i,(i+1)*1000);
onEnterFrame = function()
{
for (var tr = 0; tr < noofrow; tr++)
{

for (var tc = 0; tc < noofcolumn; tc++) {
ti = (tr * noofcolumn) + tc + pageindex;

if(ti<resourceCount)
{
tw = this["thumbframein_mc"+ti]._width;
th = this["thumbframein_mc"+ti]._height;
this["thumbframein_mc"+ti]._x = this["thumbframe"+ti]._x+(thumbwidth - tw)/2;
this["thumbframein_mc"+ti]._y = this["thumbframe"+ti]._y+(thumblength - th)/2;

}
}
}
}
this["thumbframein_mc"+i].loadMovie(loadme);
noofthumbs = (currentpage-1) * noofcolumn * noofrow;
nom = noofthumbs;
callbig(nom);
this.filename.text = " "+images[nom];
this["thumbframe"+i].onPress = function()
{
startsubstring = 10;
endsubstring = startsubstring + nodigits.length;
largeindex=this._name.substring(startsubstring,endsubstring);
callbig(largeindex);
}
}
}
}
}

function callbig(index)
{
filename.text = " "+images[index];
info.text = infotexts[index];
imageframe_mc.createEmptyMovieClip("hold",0);
imageframe_mc.pictoral._width = _global.bigframew + 3;
imageframe_mc.pictoral._height = _global.bigframeh;


my_mcl.loadClip("flashimg/img/"+images[index],this.imageframe_mc.hold);
imageframe_mc.onPress = function()
{getURL("flashimg/pics/"+images[index],"_blank");}

}



imageList_xml = new XML ();
imageList_xml.ignoreWhite = true;
imageList_xml.onLoad = function (success) {
if (success) {
imageListLoaded(whichalbum);
}
};

//////////////////////////////////////////
//HERE IS WHERE YOU DECLARE YOUR XML FILE
imageList_xml.load ("albums.xml");
//////////////////////////////////////////

rightbt.onRelease=function()
{
if(currentpage != noofpage)
{
currentpage ++;
imageListLoaded(_global.whichalbum);
}
}

leftbt.onRelease=function()
{
if(currentpage > 1)
{
currentpage --;
imageListLoaded(_global.whichalbum);
}
}
stop();
thanks and have a great weekend

Trouble With My Photo Gallery
Greetings!

I've been working with the photo gallery tutorial created by sbeener

I am trying to write code that will not only load externally stored jpgs (as the tutorial currently does), but will also simultaneously load swf files containing text descriptions into another movie clip. However, I'm having some trouble.

After I've added the additional code to load the swf files from a new array, when I test the movie, the jpgs cease loading when the swf files load.

I think I've located the source of my problems, I have two conflicting onEnterFrame commands, the latter of which I have illustrated in my code.

If anyone could take a look at my .fla file and give me some pointers on where I can go with this, I'd be indebted to you.

Thumbnail Gallery Trouble
I created a gallery using the tutorial located here:

Thumbnail Tutorial

Here is the gallery I created:
jacqueline kimberly collection

I modified it by adding the ability to call separate XML files based on a selection made at the bottom to show just earings or just necklaces from the collection. Everything works fine except, I need to find a way to clear the thumbnails each time the new xml is loaded.

For example, if a collection has 10 images, and I open another collection with 2 images, the two images load over the top of the old 10, but the remaining 8 thumbnails from the previous XML load remain. Is there a way to clear the old instance of the tscroller? Any Ideas?

Trouble XML Photo Gallery
I've got xml photo gallery which you can see at www.suziklinik.cz under the "Galerie".
Everything works pretty fine until I update the xml code with more then 5 albums. When I do that....for ex. I choose "album 2 or 3" and then I choose thumb/picture 1st or 2nd it always jumps to last album...why?
here is the flash code


Code:
this._lockroot = true;


//////////////////////////////////////////////////////////////
// SETTING VARIABLES
currentpage = 1;
_global.whichalbum = 1;



//////////////////////////////////
function scalerf(w,h)
{
diffw = (w-bigframew);
diffh = (h-bigframeh);

if(diffw<=0&&diffh<=0)
{
scaler = 1 * 100;
}
else if (diffw==Math.max(diffw,diffh)) //scale to height
{
scaler = (bigframew/w) * 100;
}
else if (diffh==Math.max(diffw,diffh)) //scale to width
{
scaler = (bigframeh/h) * 100;
}
return scaler;
}

//LOADCLIP ACTIVITIES
_root.createEmptyMovieClip("looploop",-1000);
var my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadStart = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
}
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
////////////////////////////////////////////////////////
// FOR PRELOADER PURPOSES
loaded = loadedBytes;
total = totalBytes;
percentage = Math.round(100*(loaded/total));
progressbar_mc.progresser_mc._xscale = percentage;
////////////////////////////////////////////////////////
}
myListener.onLoadComplete = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
imageframe_mc.hold._alpha=0;
velo = 0;
imageframe_mc.hold.onEnterFrame = function()
{
w = imageframe_mc.hold._width;
h = imageframe_mc.hold._height;
if(w!=0&&h!=0)
{
scaler = scalerf(w,h);
if(scaler!=100)
{
imageframe_mc.hold._xscale = scaler;
imageframe_mc.hold._yscale = scaler;
}
imageframe_mc.hold._x = (bigframew - (w*(scaler/100)))/2;
imageframe_mc.hold._y = -1+(bigframeh - (h*(scaler/100)))/2;


if(imageframe_mc.hold._alpha<100)
{
accel = 0.3;
velo = velo + accel;
imageframe_mc.hold._alpha +=velo;

}

}
}
}


myListener.onLoadInit = function (target_mc)
{
//target_mc._width = 100;
//target_mc._width = 100;
}
myListener.onLoadError = function (target_mc, errorCode)
{
}
my_mcl.addListener(myListener);


///////////////////////////////////////////////////////////////
// XML PARSING
function imageListLoaded(whichalbum) {
//clear stage
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}


//parameters
param = this.imageList_xml.firstChild.firstChild;
pc = int(param.attributes.noofcolumn);
pr = int(param.attributes.noofrow);
ptx = int(param.attributes.thumbxs);
pty = int(param.attributes.thumbys);
_global.ptw = int(param.attributes.thumbwidth);
_global.ptl = int(param.attributes.thumbheight);
_global.bigframew = int(param.attributes.bigframewidth);
_global.bigframeh = int(param.attributes.bigframeheight);
albumnamesx = int(param.attributes.albumnamesxs);
albumnamesy = int(param.attributes.albumnamesys);
albumnamescolor = param.attributes.albumnamescolor;
//////////////////////////////////////////////////////////////

var albumCountXML = this.imageList_xml.firstChild.childNodes;
albumCount = albumCountXML.length - 1;

var mainNode = this.imageList_xml.firstChild.childNodes[whichalbum].firstChild;
var listBoxData = createResourceList (mainNode.childNodes,pc,pr,ptx,pty,ptw,ptl);
//////////////////////////////////////////////////////////////////
// Number of Album
albumtextbox.text = "Album "+whichalbum+">>>";
albumtextbox.background = true;
albumtextbox.backgroundColor = 0xF0CC64;
for (t=1;t<=albumCount;t++)
{

category.text = "A L B U M Y";
//category.background = true;
category.backgroundColor = 0xF0CC64;
/////////////////////////////////////////////////////////////
//Creating text box

this.createEmptyMovieClip("albumnames"+t,900+t);
albumname_mc = this["albumnames"+t];
albumname_mc.createTextField("albumnametxt"+t,1000+t,0,0,200,200);
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = albumnamescolor;
my_fmt.font = "Tahoma"
my_fmt.size = 11;
albumname_mc["albumnametxt"+t].text = this.imageList_xml.firstChild.childNodes[t].attributes.albumname;
albumname_mc["albumnametxt"+t].setTextFormat(my_fmt);
albumname_mc._x = albumnamesx;
albumname_mc._y = albumnamesy + t * 15;
albumname_mc.sett = t;
albumname_mc.onRelease = function()
{
currentpage = 1;
filename.text = "";
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}
imageListLoaded(this.sett)
_global.whichalbum = this.sett;
}
}


}


function createResourceList(resource_array,noofcolumn,noofrow,thumbxs,thumbys,thumbwidth,thumblength,bigimagewidth) {
_global.noofcolumn = noofcolumn;
_global.noofrow = noofrow;
var listData = new DataProviderClass ();
resourceCount = resource_array.length;
noofpage = Math.ceil(resourceCount/(noofcolumn*noofrow));
ofof.text = "strana: "+currentpage+"/"+noofpage;
ofof.background = true;
ofof.backgroundColor = 0xF0CC64;
var resource, image, tmb;
images = new Array();
infotexts = new Array();

pageindex =((currentpage-1) * noofrow * noofcolumn);

for (var r = 0; r < noofrow; r++)
{

for (var c = 0; c < noofcolumn; c++) {
i = (r * noofcolumn) + c + pageindex;

if(i<resourceCount)
{
nodigits = new String(resourceCount);
resource = resource_array[i];
images[i] = resource.attributes.imagename;
infotexts[i] = resource.attributes.infotext;
loadme = "flashimg/thmb/"+images[i];
findme = images[i];
whichframe = "frame"+i;
this.attachMovie("thumbframe","thumbframe"+i,i+1);
this["thumbframe"+i]._x = (c * thumbwidth)+thumbxs;
this["thumbframe"+i]._y = (r * thumblength)+thumbys;
createEmptyMovieClip("thumbframein_mc"+i,(i+1)*1000);
onEnterFrame = function()
{
for (var tr = 0; tr < noofrow; tr++)
{

for (var tc = 0; tc < noofcolumn; tc++) {
ti = (tr * noofcolumn) + tc + pageindex;

if(ti<resourceCount)
{
tw = this["thumbframein_mc"+ti]._width;
th = this["thumbframein_mc"+ti]._height;
this["thumbframein_mc"+ti]._x = this["thumbframe"+ti]._x+(thumbwidth - tw)/2;
this["thumbframein_mc"+ti]._y = this["thumbframe"+ti]._y+(thumblength - th)/2;

}
}
}
}
this["thumbframein_mc"+i].loadMovie(loadme);
noofthumbs = (currentpage-1) * noofcolumn * noofrow;
nom = noofthumbs;
callbig(nom);
this.filename.text = " "+images[nom];
this["thumbframe"+i].onPress = function()
{
startsubstring = 10;
endsubstring = startsubstring + nodigits.length;
largeindex=this._name.substring(startsubstring,endsubstring);
callbig(largeindex);
}
}
}
}
}

function callbig(index)
{
filename.text = " "+images[index];
info.text = infotexts[index];
imageframe_mc.createEmptyMovieClip("hold",0);
imageframe_mc.pictoral._width = _global.bigframew + 3;
imageframe_mc.pictoral._height = _global.bigframeh;


my_mcl.loadClip("flashimg/img/"+images[index],this.imageframe_mc.hold);
imageframe_mc.onPress = function()
{getURL("flashimg/pics/"+images[index],"_blank");}

}



imageList_xml = new XML ();
imageList_xml.ignoreWhite = true;
imageList_xml.onLoad = function (success) {
if (success) {
imageListLoaded(whichalbum);
}
};

//////////////////////////////////////////
//HERE IS WHERE YOU DECLARE YOUR XML FILE
imageList_xml.load ("albums.xml");
//////////////////////////////////////////

rightbt.onRelease=function()
{
if(currentpage != noofpage)
{
currentpage ++;
imageListLoaded(_global.whichalbum);
}
}

leftbt.onRelease=function()
{
if(currentpage > 1)
{
currentpage --;
imageListLoaded(_global.whichalbum);
}
}
stop();
and for any case here is xml code

Code:
<!--
bigframeheight: the top big frame's height
bigframewidth: the top big frame's width
noofcolumn: number of columns for the thumbnails
noofrow: number of row for the thumbnails
thumbxs: x coordinate of thumbnails matrix(topleft)
thumbys: y coordinate of thumbnails matrix(topleft)
thumbwidth: a single thumbnail holder's width
thumbwidth: a single thumbnail holder's height
albumnamesxs: x coordinate of albumnames' list
albumnamesys: y coordinate of albumnames' list
albumnamescolor: Color code for albumnames' texts
-->

<photoalbum>
<parameters bigframeheight = "264" bigframewidth = "451" noofcolumn="8" noofrow="1" thumbxs="10" thumbys="275" thumbwidth="74" thumbheight="73" albumnamesxs="0" albumnamesys="0" albumnamescolor="0xF0CC64"/>
<album albumname="1 ~ Jeep">
<images>
<image imagename="jeep0001.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0002.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0003.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0004.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0005.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0006.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0007.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0008.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0009.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0010.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0011.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0012.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0013.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0014.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0015.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0016.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0017.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0018.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0019.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0020.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0021.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0022.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0023.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0024.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0025.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0026.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0027.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0028.jpg" infotext="Jeep Restaurování"/>
</images>
</album>
<album albumname="2 ~ Motor 1.3 ">
<images>
<image imagename="engine0001.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0002.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0003.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0004.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0005.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0006.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0007.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0008.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0009.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>

</images>
</album>
<album albumname="3 ~ V Akci">
<images>
<image imagename="action0001.jpg" infotext="V Akci" />
<image imagename="action0002.jpg" infotext="V Akci" />
<image imagename="action0003.jpg" infotext="V Akci" />
<image imagename="action0004.jpg" infotext="V Akci" />
<image imagename="action0005.jpg" infotext="V Akci" />
<image imagename="action0006.jpg" infotext="V Akci" />
<image imagename="action0007.jpg" infotext="V Akci" />
<image imagename="action0008.jpg" infotext="V Akci" />
</images>
</album>
<album albumname="4 ~ Ford Transit">
<images>
<image imagename="transit0001.jpg" infotext="" />
<image imagename="transit0002.jpg" infotext="" />
<image imagename="transit0003.jpg" infotext="" />
<image imagename="transit0004.jpg" infotext="" />
<image imagename="transit0005.jpg" infotext="" />
</images>
</album>
<album albumname="5 ~ Transit po Požáru">
<images>
<image imagename="fire0001.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0002.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0003.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0004.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0005.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0006.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0007.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0008.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0009.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0010.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0011.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0012.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0013.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0014.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0015.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0016.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0017.jpg" infotext="Ford Transit po Požáru" />
</images>
</album>
<album albumname="6 ~ Projekt Tatarak">
<images>
<image imagename="tatarak0001.jpg" infotext="" />
<image imagename="tatarak0002.jpg" infotext="" />
<image imagename="tatarak0003.jpg" infotext="" />
<image imagename="tatarak0004.jpg" infotext="" />
<image imagename="tatarak0005.jpg" infotext="" />
<image imagename="tatarak0006.jpg" infotext="" />
<image imagename="tatarak0007.jpg" infotext="" />
<image imagename="tatarak0008.jpg" infotext="" />
<image imagename="tatarak0009.jpg" infotext="" />
<image imagename="tatarak0010.jpg" infotext="" />
<image imagename="tatarak0011.jpg" infotext="" />
<image imagename="tatarak0012.jpg" infotext="" />
<image imagename="tatarak0013.jpg" infotext="" />
<image imagename="tatarak0014.jpg" infotext="" />
<image imagename="tatarak0015.jpg" infotext="" />
<image imagename="tatarak0016.jpg" infotext="" />
<image imagename="tatarak0017.jpg" infotext="" />
<image imagename="tatarak0018.jpg" infotext="" />
<image imagename="tatarak0019.jpg" infotext="" />
<image imagename="tatarak0020.jpg" infotext="" />
<image imagename="tatarak0021.jpg" infotext="" />
<image imagename="tatarak0022.jpg" infotext="" />
<image imagename="tatarak0023.jpg" infotext="" />
<image imagename="tatarak0024.jpg" infotext="" />
<image imagename="tatarak0025.jpg" infotext="" />
<image imagename="tatarak0026.jpg" infotext="" />
<image imagename="tatarak0027.jpg" infotext="" />
<image imagename="tatarak0028.jpg" infotext="" />
<image imagename="tatarak0029.jpg" infotext="" />
<image imagename="tatarak0030.jpg" infotext="" />
<image imagename="tatarak0031.jpg" infotext="" />
<image imagename="tatarak0032.jpg" infotext="" />
<image imagename="tatarak0033.jpg" infotext="" />
<image imagename="tatarak0034.jpg" infotext="" />
<image imagename="tatarak0035.jpg" infotext="" />
<image imagename="tatarak0036.jpg" infotext="" />
<image imagename="tatarak0037.jpg" infotext="" />
<image imagename="tatarak0038.jpg" infotext="" />
<image imagename="tatarak0039.jpg" infotext="" />
<image imagename="tatarak0040.jpg" infotext="" />
<image imagename="tatarak0041.jpg" infotext="" />
<image imagename="tatarak0042.jpg" infotext="" />
<image imagename="tatarak0043.jpg" infotext="" />
<image imagename="tatarak0044.jpg" infotext="" />
<image imagename="tatarak0045.jpg" infotext="" />
<image imagename="tatarak0046.jpg" infotext="" />
<image imagename="tatarak0047.jpg" infotext="" />
<image imagename="tatarak0048.jpg" infotext="" />
<image imagename="tatarak0049.jpg" infotext="" />
<image imagename="tatarak0050.jpg" infotext="" />
<image imagename="tatarak0051.jpg" infotext="" />
<image imagename="tatarak0052.jpg" infotext="" />
<image imagename="tatarak0053.jpg" infotext="" />
<image imagename="tatarak0054.jpg" infotext="" />
<image imagename="tatarak0055.jpg" infotext="" />
<image imagename="tatarak0056.jpg" infotext="" />
<image imagename="tatarak0057.jpg" infotext="" />
<image imagename="tatarak0058.jpg" infotext="" />
<image imagename="tatarak0059.jpg" infotext="" />
<image imagename="tatarak0060.jpg" infotext="" />
<image imagename="tatarak0061.jpg" infotext="" />
<image imagename="tatarak0062.jpg" infotext="" />
<image imagename="tatarak0063.jpg" infotext="" />
<image imagename="tatarak0064.jpg" infotext="" />
<image imagename="tatarak0065.jpg" infotext="" />
<image imagename="tatarak0066.jpg" infotext="" />
<image imagename="tatarak0067.jpg" infotext="" />
<image imagename="tatarak0068.jpg" infotext="" />
<image imagename="tatarak0069.jpg" infotext="" />
<image imagename="tatarak0070.jpg" infotext="" />
</images>
</album>
<!--<album albumname="7 ~ Náš TUNING">
<images>
<image imagename="tuning0001.jpg" infotext="" />
<image imagename="tuning0002.jpg" infotext="" />
<image imagename="tuning0003.jpg" infotext="" />
<image imagename="tuning0004.jpg" infotext="" />
<image imagename="tuning0005.jpg" infotext="" />
<image imagename="tuning0006.jpg" infotext="" />
<image imagename="tuning0007.jpg" infotext="" />
<image imagename="tuning0008.jpg" infotext="" />
<image imagename="tuning0009.jpg" infotext="" />
<image imagename="tuning0010.jpg" infotext="" />
<image imagename="tuning0011.jpg" infotext="" />
<image imagename="tuning0012.jpg" infotext="" />
<image imagename="tuning0013.jpg" infotext="" />
<image imagename="tuning0014.jpg" infotext="" />
<image imagename="tuning0015.jpg" infotext="" />
</images>
</album>-->
<!--<album albumname="8 ~ Sady">
<images>
<image imagename="sady0001.jpg" infotext="" />
<image imagename="sady0002.jpg" infotext="" />
<image imagename="sady0003.jpg" infotext="" />
<image imagename="sady0004.jpg" infotext="" />
</images>
</album>-->
</photoalbum>
thanks guys

XML Gallery Thumbnail Trouble
Hi all, I've just worked through the XML gallery with thumbnails tutorial and something bizarre is happening to my thumbnails. They scroll fine form left to right but when they first load in the load into the centre of the field. Why would this be happening? I've not altered the code in any way.
I've put up an example to show you what I mean here: http:www.bencatchpole.co.uk/michele/

Ta

Flash Gallery With XML Trouble
I am making a site with a scrolling photo gallery. The site is located at
www.finstofurstaxidermy.com/taxidermy.html
I have a scrolling thumbnail gallery that is perfect for me. I am happy with it with one exception. I used the loadmovie function to make it and for some reason it takes a long time on slower internet for the movie to initially load. What i would like to do is have the movie open up fairly fast and the individual pictures can load once they are clicked. I want to use xml however i don't know how to do it. I would like to keep the same setup on my photo page but i want to use xml because i think it would be better on loading. I am interested in this type of gallery.

www.finstofurstaxidermy.com/fashmo.swf

I found this online and put it on my server. I love this gallery I just want these effects and xml layout in my gallery. I dont even have to have the cool fade effects i just need the site to load faster and the pictures to load individually. Please i need some help anyone.

Photo Gallery Trouble
i'm a newbie in AS but i'm willing to learn and i've started to make my own flash site...made some simple motion tween, some buttons and then i wanted to make a simple photo gallery but using a transition effect by using action script cause this way i could make the transition backwards unlike using a motion tween that can only make the transition forward...
so googling i found this:
http://tutorialoutpost.com/view/4717...photo-gallery/
i saw that tutorial to work pretty well so i made a movie clip inside another movie clip inside my flash site and i repeated the tutorial above only this time on a movie clip and not on the main scene... and it just wont work...
the only thing i see is the blue shape that is under the mask and where the photos should appear...
any idea what i did wrong here??

Trouble With Positioning Of Images In Gallery
I decided I should probably post this in the Newbie forum rather than the ActionScript forum, since I am a noob to Flash and this is more of a general Flash question than an ActionScript one.

I'm trying to create a Flash gallery of image files I will later embed within another Flash file to create a portfolio of some of my art and design work. The gallery I'm working with is a modified version of the one found at kirupa.com at http://www.kirupa.com/developer/mx2004/thumbnails2.htm .

For reference, here is the .fla file I'm working with right now (I'm using Flash 8, btw):
http://www.johnmilesart.com/Sketches/Sketches.fla
Here's a version saved for MX 2004:
http://www.johnmilesart.com/Sketches/SketchesMX2004.fla

Here is the associated .xml file:
http://www.johnmilesart.com/Sketches/images.xml

And here is the compiled .swf file:
http://www.johnmilesart.com/Sketches/Sketches.swf

The images themselves are located under the directory http://www.johnmilesart.com/Sketches/SketchesImages/ . They are gloveandhat.jpg , ladyinhatandglasses.jpg , and newbalance.jpg .

As you will see once you take a look at the .swf, I'm having some trouble getting the images to display zoomed and positioned how I want them. I have a box 500 px in width and 400 px in height set up to display them, and each image has been created at exactly these dimensions to fit perfectly. However, for some reason the images are displaying zoomed in and positioned off-center. I'm sure there's a relatively easy solution to this problem, but being new to Flash, it's evading me right now. I'd appreciate it greatly if someone could help me out a bit with this. Also, as you'll probably notice, I decided to remove the thumbnail navigation aspect, leaving just the next and previous buttons to navigate. If someone could help me remove the leftover thumbnail code to save space, that would be great.

Thanks again!

Trouble With Preloading For Flash Gallery
Go to this link to see what I mean:

http://www.philleith.com/BJ.html

The images are loading but the preloader is saying "100%" with a full bar as if they are taking no time to load. If you look at the third photo, it it takes a little while to load and the preloader says the same thing -- so I know there is a problem. What it SHOULD do is have an increasing status bar and percentage as it loads in.

This works fine when I run it in flash when I Simulate Download, but for some reason when I put it up online, it gets weird.

If anyone knows what may be causing this, please enlighten me I would much appreciate it

Having Trouble With Flash Gallery When Repositioning
the gallery I downloaded from http://www.kirupa.com/developer/mx20...togallery9.htm
has a problem that I cannot solve
when I increase the carvas size to 1000 by 700, and I move the whole gallery to right at the center of the carvas, and then I test movie, it ceased working, when I undo the last step, it fix itself, I just don't understand, I read through the code, nothing is really concerning the carvas size, but it's just so weird, help!!

Trouble With The Photo Gallery Using XML And Flash
The tutorial was great, I renamed the mc to mygallery. When I test mygallery locally everything works fine. However, I am loading it externally into my main mc. When I do this I encounter the following problem.

the mc appears to load however the first image will no load, if I click next, the second will load and then I can click previous and the first will then load.

I have traced it to the firstImage() function and it won't get past this line
if (loaded == filesize)

loaded is TRUE
filesize is UNDEFINED
picture is UNDEFINED

I've tried my best to figure it out but I was hoping someone had the answer.

Cheers!
Dan

Gallery + XML Trouble With Opera And Firefox
Please, someone could help me?

When I access my page that cointains the XML Gallery (tutorial by kirupa) with Opera and Firefox, nothing works! It only works in Internet Explorer. Well, it's not working when the site is online, because here, at my computer, offline, everything works!

The address is: http://www.portalcachoeirademinas.co...ver/amelia.htm

The files used there are here: http://rapidshare.de/files/20235606/Gallery.zip.html

I don't know why Opera and Firefox doesn't load the pictures when the site is in the server.

Pls, help me!!!

And I don't speak English, Google helps me a lot, but I know that it's not perfect... Sorry...

XML Gallery W/ Thumbnails Compatibility Trouble ...
hey guys,
I'm new here, pretty new to flash, and a baby at actionscripting.

I found the wonderful XML photogallery with thumbnails tutorial here at kirupa and got it to work really fast. I didn't change anything at the actionscript, just played around with positioning, added some other images, tried renaming options in the xml-data.

offline everything works well. if i put it online on my server it works perfectly in IE, it works in firefox (but the status-bar says "loading data from serverblah.com") and in safari it just doesn't work. the thumbnails load correctly, thumbnail scrolling works, the first picture loads - but proceeding in the gallery is noct possible. neither by clicking "next", nor by clicking a thumbnail.

hat makes it even stranger: when i click on any thumbnail, the picture requested doesn't load, but if I click the "previous"-button, the right "previous" image loads half, it stops at ca. 50% alpha with the load-bar still visible.

does anyone have an idea or a suggestion how to fix this?

here's the swf: http://www.kardanwelle.com/porto-tes..._final-u1.html

here's the fla:http://www.kardanwelle.com/porto-tes...l_final-u1.fla

here's the xml: http://www.kardanwelle.com/porto-tester/images.xml

I'm really confused... it shouldn't be a path-issue ... I don't know what I am doing wrong.

Please, if anyone got some help to offer, I'm trying to get my portfolio online...

thanks in advance!

Having Trouble Creating A Thumbnail Gallery
I tried using the xml photo gallery tutorial, but they didn't seem to help me.

What i'm trying to do is build a thumbnail gallery inside a scrollbar area, so that when you click on a thumbnail, it will load the image on the outside of the scrollbar area.

Gallery Trouble, Works In Ie, But Not FF Or Opera
hey

ok, not sure how simple this is, but ive made a gallery, loosely based on the kirupa one. basically, I have a border that resizes, then the image shows in it. This all works fine in IE, but when it is viewed in FF and Opera, the box does not resize, it goes all small. Hard to explain lol. here are some links;

the actual flash page:

http://munkydesigns.co.uk/burls/index.html

the files

http://munkydesigns.co.uk/burls/burls.zip

Here is the code in question for the resizing:


Code:
function resizeMe(w, h){
mc_border._visible = true;
var speed = 3;
_root.mc_image._alpha = 0;

mc_border.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.mc_image._x = this._x - this._width/2 + spacing/2;
_root.mc_image._y = this._y - this._height/2 + spacing/2;
_root.mc_image._alpha = 100;
delete mc_border.onEnterFrame;

}

}
}
Ive got to have this in for a deadline on Monday

If anyone can help, it'd be greatly appreciated!

Image Gallery... Save Image To Computer?
Hey all,
I just wondered if there was a way to save image files in a dynamic gallery? For example... when an image is displayed, a little save icon appears that allows the user to save the jpeg file to their computer. Thanks!

XML Image Gallery: Replacing Xml To Load New Image Set?
Hi Kirupa crew!

First, big thanks for this great site!

Second, I'm struggling a bit on xml and hoping for a hand. Your xml image gallery is a sweet piece of work, and I would like to be able to add the functionality of being able to load different galleries from a menu without loading a new mc with gallery inside it. I managed to botch the file up pretty good on my own, and was wondering if there is a ready answer nearby.

So I'm thinking have but1, but2 and but3, with a seperate xml file for each. What would you recommend for a smooth way to swap the the xml files to the gallery, and load the first image of the new xml file? Also, can it be done with one big ol' xml file while keeping the galleries seperate? It's not necessary, but could be handy, and save some loading.

It would also be interesting to apply the same principle to the resizing script that Scotty has in that big Resizing thread, just a thought.

Many many thanks!
John

Gallery Image Loading - Getting Image Width..help
Ladies and gents:

having a problem with my code somewhere; I'm stumped. Here's what i'm trying to do:

-When you click on a thumbnail in my gallery a load bar appears that is the width of the loading image
-While the image loads the load bar scales from full width to zero
-Once it finishes loading the image fades in
-Click on a new thumbnail, and the old image fades out, then the scrollbar is supposed to take the width of the NEW image and do the same thing

What is happening is that the scrollbar width does not set itself to the new image size until i click the thumbnail a second time...try this link to see what i mean. it's on the "portfolio" page.

http://www.lewisweb.ws/staging

here's the code:



Code:
//CONSTANTS
frame_x = 387; //the exact x coordinate where the box originates
frame_y = 184; //the exact y coordinate where the box originates
alphaSpeed = 5; //spped at which the pics fade in

//INITIAL SETTINGS
containerMC._alpha = 0;
containerMC._x = frame_x;
containerMC._y = frame_y;

//Fades in a picture loaded externally
MovieClip.prototype.loadPic = function(pic){
containerMC.fadeOldPic(); //fade out old picture
containerMC._alpha = 0;
this.loadMovie(pic); //load new pic
var loadIsComplete = false; //reset load checker
var w = containerMC._width;
loadBar._width = w; //set loadbar to new movieclip width
loadBar._alpha = 100; //make loadbar opaque
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
loadIsComplete = (Math.round(l/t) == 1); //check to see if load completed
loadBar._width = w - ((l/t) * w); //sets width of loadbar dynamically
if (loadIsComplete){
containerMC._alpha += alphaSpeed; //if load is complete, fade pic in
}
//if the load is complete and the picture is fully faded in...
if (t != 0 && loadIsComplete && _root.containerMC._alpha == 100){
loadBar._alpha = 0; //make the load bar disappear
delete _root.onEnterFrame;
}
}
};

//Fades out an old picture...pretty self explanatory
MovieClip.prototype.fadeOldPic = function(){
_root.onEnterFrame = function(){
_root.containerMC._alpha -= alphaSpeed;
if (_root.containerMC._alpha == 0){
delete _root.onEnterFrame;
}
}
};

containerMC.loadPic("portfolio/westin.jpg");
stop();
ANY help will be appreciated!

Kirupa XML Image Gallery - Skip To Image
So I'm having some trouble modifying this script. I have a text box so a user can go to a certain image (In my case page). So if the user type 5 it should go to image 5.

I've tried numerous methods, none of which are working (they work but then my next and previous buttons aren't working properly). I know I need to just get go to the number image in the array but the way the script is set up it seems I would have to change the current position value but that doesn't seem to be the case.

Am I over complicating this?

ActionScript Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml/config.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++;
picture._alpha = 0;
picture.loadMovie("images/"+image[current_pos]+".jpg", 1);
picture_num();
}
}

function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie("images/"+image[p]+".jpg", 1);
picture_num();
}
}

function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie("images/"+image[0]+".jpg", 1);
picture_num();
}
}


function picture_num() {
current_pos = p+1;
_root.currPageNum.text = "Page " + current_pos;
}

_root.goButton.onPress = function(){
// load the image typed into the text area.
}

Flash 8 - Help W Xml Image Gallery, Thumbnails For Each Image
Hey.

New here and have found some really good tutorials! Thanks.
I desperately need a bit of help with some Actionscripting if anyone has any ideas how to do this?
I have created a photo gallery using the kirupa tutorial. That works fine. Now for each main image that the code cycles through my client wants 1-3 thumbnails to display on the side of the image and they should all be clickable and display full size in place of the main image when clicked. The previous and next buttons should still only go through the main images. Here is the xml code (as I imagine it should look like):

[code]

Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>images/bowandkey_main.jpg</image>
<caption>Bow and Key Necklace: Ł225.00</caption>
<description>Mother of pearl (or onyx) necklace with silver-plated bow and key, cast from vintage originals </description>
<thumbnail>
<thumb1>thumbnails/bowandkey_main.jpg</thumb1>
<thumb2>thumbnails/bowandkey_portrait.jpg</thumb2>
<thumb3>thumbnails/bowandkey_closeup.jpg</thumb2>
</thumbnail>
</pic>
<pic>
<image>images/bowandkey2_main.jpg</image>
<caption>Bow and Key Necklace: Ł230.00</caption>
<description>Onyx necklace with silver-plated bow and key, cast from vintage originals </description>
<thumbnail>
<thumb1>thumbnails/bowandkey2_main.jpg</thumb1>
<thumb2>thumbnails/bowandkey2_portrait.jpg</thumb2>
</thumbnail>
</pic>
<pic>
<image>images/crossedfingers.jpg</image>
<caption>Crossed Fingers Necklace: Ł150.00</caption>
<description>Solid silver crossed fingers good luck charm, cast from 1940s celluloid gumball toy, strung on mother of pearl or onyx beads.</description>
<thumbnail>
<thumb1>thumbnails/crossedfingers_main.jpg</thumb1>
<thumb2>thumbnails/crossedfingers_closeup.jpg</thumb1>
</thumbnail>
</pic>
</images>
The thumb 1,2 and 3 are childNodes of thumbnail.

I have created a MovieClip holder to hold the thumbnails. Could someone please show me how to add to the Actionscript so that it loops through (displays) the thumb1 - thumb 3 for each main image? I suppose I would have to store the thumbnails for each image in separate folders so the flash can determine the length of the array of thumbnails for each image? And then make them clickable.

I am pulling my hair out here not getting this working... Any hinters on what to do would be greatly appreciated!

Here is the actionscript code for the image gallery:


Code:

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
caption = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
caption[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("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);
cap_txt.text = caption[p];
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
cap_txt.text = caption[p];
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
cap_txt.text = caption[0];
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Thanks!!

XML Image Gallery: Replacing Xml To Load New Image Set?
Hi Kirupa crew!

First, big thanks for this great site!

Second, I'm struggling a bit on xml and hoping for a hand. Your xml image gallery is a sweet piece of work, and I would like to be able to add the functionality of being able to load different galleries from a menu without loading a new mc with gallery inside it. I managed to botch the file up pretty good on my own, and was wondering if there is a ready answer nearby.

So I'm thinking have but1, but2 and but3, with a seperate xml file for each. What would you recommend for a smooth way to swap the the xml files to the gallery, and load the first image of the new xml file? Also, can it be done with one big ol' xml file while keeping the galleries seperate? It's not necessary, but could be handy, and save some loading.

It would also be interesting to apply the same principle to the resizing script that Scotty has in that big Resizing thread, just a thought.

Many many thanks!
John

Trouble With The Photo Gallery Using XML And Flash Tutorial.
Hello Kirupa forumers,

I am currently having trouble with my photo gallery as it is not loading my images. I have followed the Kirupa tutorial and yes I have edited the Xml file but it's still not loading. Is there a percific format example: .jpg, .gif etc. ?
Please help me on this one.

Thanks.
Dan.

Trouble With The Photo Gallery Using XML And Flash Tutorial.
Hello Kirupa forumers,

I am currently having trouble with my photo gallery as it is not loading my images. I have followed the Kirupa tutorial and yes I have edited the Xml file but it's still not loading. Is there a percific format example: .jpg, .gif etc. ?
Please help me on this one.

Thanks.
Dan.

Trouble Customizing Sbeener Photo Gallery Code
Not sure if this problem has been sorted out already in an earlier post if so, please direct me to where it is. Tnx.

Basically my photos wont show up on the final swf, even after i've customized the this.pathToPics and this.pArray codes. The pics are in a subfolder where the swf itself is saved. Directing the this.pathToPics to this subfolder and listing the pics on the this.pArray should do the trick right? Or is there something else? Anything else i need to change in the code? Please help!

Trouble Loading An External XML Gallery Into A Movie Clip
I am buidling a website in which i am importing external movie clips (swfs) using actions script 2.0
all of my imported movie clips so far work fine, but when it comes to import the xml gallery the who website goes in a loop. here is the script i am using to load the external movie clips.
/////////

this.createEmptyMovieClip("container");
container.loadMovie("xmlgallery.swf");
stop();

////////

is very basic but it works for what i am doing. the question is HOW DO I LOAD THE XML GALLERY if this basic script doesn't work for it is there another way to do it?

I appreciate the help THANKS!

Trouble Customizing Sbeener Photo Gallery Code
Not sure if this problem has been sorted out already in an earlier post if so, please direct me to where it is. Tnx.

Basically my photos wont show up on the final swf, even after i've customized the this.pathToPics and this.pArray codes. The pics are in a subfolder where the swf itself is saved. Directing the this.pathToPics to this subfolder and listing the pics on the this.pArray should do the trick right? Or is there something else? Anything else i need to change in the code? Please help!

Image Gallery - Image Width
Hi,

I'm putting an image gallery together with all the pictures at the same _y. Here's my AS code:


a = 1;
pushOverX = 0;
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if (success) {
while (a<100) {
slider_mc.attachMovie("holder", "holder"+a, a, {_xushOverX, _y:0});
set("slider_mc.holder"+a+".load_var", eval("this.data"+a));
a = a+1;
pushOverX = pushOverX+100;
if (eval("this.data"+a) == undefined) {
break;
}
}
}
};
my_lv.load("load_in/image_data.txt");


All that works fine. However, I would like the images to be placed on the _x axis according to the width of each previous image instead of relying on pushOverX = pushOverX+100;

At the moment, an image is placed every 100px, but if an image is 50, I want the following one to be placed 50px after it and not fixed at every 100px.

Has anybody got an idea?

Thanks

Help- How To Load First Image From XML Image Gallery
Hi-
Help- I'd like to making the first image load onto movie. Attached is the code. Any hints would be awesome.

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 70;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbLoader = thumbholder.createEmptyMovieClip("thumbnail_image" , 0);
thumbLoader.loadMovie(picHolder.attributes.appthmb );
thumbHolder.app = picHolder.attributes.app;
thumbHolder.appdesc = picHolder.attributes.appdesc;
thumbHolder.appmain = picHolder.attributes.appmain;
thumbHolder.onRelease = function() {
loader.loadMovie(this.appmain);
app_txt.text = this.app;
appdesc_txt.text = this.appdesc;
};
}
};
myPhoto.load("appphoto.xml");

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 - Setting X,y Of Image Via XML?
I'm working on version of Kirupa's XML Image Gallery, only I want to be able to set the x,y coordinates individually for each image. How do I do this via the XML.

I'm trying this to no avail:
XML looks like this:

<pic>
<image x="0" y="0">001.jpg</image>
<caption>description line 1</caption>
<caption2>description line 2</caption2>
<caption3>description line 3</caption3>
</pic>

<pic>
<image x="100" y="200">002.jpg</image>
<caption>description line 1</caption>
<caption2>description line 2</caption2>
<caption3>description line 3</caption3>
</pic>

Actionscript looks like this:

function placeImage() {
var image_x:Number = Number(picture.attributes.x);
var image_y:Number = Number(picture.attributes.y);
}

Can anyone let me know what I'm doing wrong, what I'm missing?
Or how better to go about this?

Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved