Click to See Complete Forum and Search --> : FLASH Image Gallery need some minor adjustments
WhiteDragon
09-07-2008, 12:00 PM
Hello, if anyone has experience with Flash, I have a image gallery that I'm looking to have two simple things done with it,
a) it add a brief description to each image
b) a tab to switch between another gallery within the gallery
If anyone could help me out I would appreciate it. I'm not sure if it's AS2 or AS3
Eye for Video
09-07-2008, 06:45 PM
Use an image gallery which uses an xml file to bring in the photos. At the same time it can bring in a caption along with each photo. Of course this all need to be coded into the AS of the gallery, so look for one with these features or build your own from scratch. Example .xml file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<pictures>
<picture caption="Locals make tracks to new HI Express!" url="elk1.jpg" />
<picture caption="Looking for the Roosevelt Room." url="elk2.jpg" />
<picture caption="Leave no footprints... oops, sorry." url="elk3.jpg" />
<picture caption="OK... it can get a little muddy." url="elk4.jpg" />
</pictures>
The navigation would also be built into buttons within the .swf which holds your galleries. How this is implemented all depends on if your separate galleries are part of one encompassing .swf or if each gallery is separate.
Example (AS2) of navigating to different frame in main timeline:
tab_mc2.onRollOver = function() {
gotoAndPlay("_over");
}
Example (AS2) of navigating to different html page (or gallery):
contact_btn.onRelease = function(){
getURL("contact_us.html");
}
www.gotoandlearn.com
and
www.learnflash.com
for tutorials
Keep on Truckin’
Eye for Video
www.cidigitalmedia.com
WhiteDragon
09-07-2008, 07:52 PM
Do you know how to do this? The AS gallery I have got does have XML data so it's just a matter of getting the caption for the images.
For the tab I just want one tab and it you would click it and it would just show a different set of thumbnails below in which you would just click. I didn't create this gallery
Eye for Video
09-07-2008, 08:31 PM
Do you have Flash so that you can get in and edit the file? Then you'll need the .fla file to do that.
Or, you could always create your own gallery from scratch, but at least you need the Flash program. If you do, we'll get it done.
EfV
WhiteDragon
09-07-2008, 08:38 PM
I have the FLA and I have Flash CS3 !
WhiteDragon
09-07-2008, 10:47 PM
So it can be edited, I hope so !
Eye for Video
09-07-2008, 11:24 PM
OK then, let’s get to work!
I’ve got Flash 8 so you may have to make a few adjustments as we go, but at least you’ll get the idea.
First, where ever you want your captions to appear, you’ll have to create a Dynamic Text box. Be sure to give it an instance name like “caption_txt”. If you want to use some weird font for this, now is the time to “embed” it.
If your caption is to appear over a portion of you image, you may want to place a semi-transparent backgound behind the caption (on its own layer).
Well that was easy!
Now, depending on how you are loading the images, you’ll need to match that process with the loading of the captions. Addressing the correct child/node relationship in the xml is crucial. So for example purposes, here’s one:
var ssx:XML = new XML();
ssx.ignoreWhite = true;
var currentIndex:Number = 0;
var urls:Array = new Array();
/* you should find this part already in your code
now create a new array for your captions
*/
var captions:Array = new Array();
ssx.onLoad = function(success){
if (success) {
var ss:Array = ssx.firstChild.childNodes;
/* this part describes the depth into the xml file that we are drilling, adjust for your own xml */
for (i=0;i<ss.length;i++) {
urls.push("ss_images/" + ss[i].attributes.url);
/* this part should be in the code already, filling the url array, from a special image folder called ss_images
now, let’s fill the captions array
*/
captions.push(ss[i].attributes.caption);
}
holder_mc.loadMovie(urls[currentIndex]);
caption_txt.text = captions[currentIndex];
/* this part loads the image and puts in the caption */
}
else
{
trace("XML file failed to load. Please try again later.");
}
}
ssx.load("whw.xml");
I’ll attach a sample .fla without all this comment stuff, it’ll have a couple simple buttons also. Create a folder called "ss_images" and and some images so the xml works (check xml for urls).
Keep on Truckin’
Eye for Video
www.cidigialmedia.com
WhiteDragon
09-08-2008, 12:46 AM
Here is the flash gallery that I have, in which I would hope to have a caption and a tab to switch to another set of thumbnails but within the same gallery, and also I hope you could tell me how this gallery handles images of different sizes, does it scale them all cause that is something I would hope not to happen.