XML Driven Flash Photo Gallery Thumbnails
Hi,
I need to make a XML Driven Photo slide in Flash CS5.
It needs to have a Box that contains 5 Thumbnails(by XML) act as buttons.
The Box sits on top of the Main photo area and shrinks (or close out) when user click its close button. And it opens out by clicking on a open button.
I'm sure it can be done by using timeline, Tweening or you name it..But what about the Thumbnails that run from the XML file?
Can they disappear with the Box and retrieve when it opens? is it possible?
If yes, what would be the best way to do that?
Any comment would be greatly appreciated!
Here is the ActionScript.
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
import fl.controls.Button;
import flash.display.Shape;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.text.TextField;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.display.Shader;
var hasloaded:Boolean = false;
var firstLoaded:Boolean = false;
var barWidth:int;
var barHeight:int;
var images;
var imageCount:int;
var thumbnailArray:Array = new Array();
var bigImageArray:Array = new Array();
var descriptionArray:Array = new Array();
var xmlLoader:URLLoader = new URLLoader();
var imageXML:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("slideshow.xml"));
function LoadXML(e:Event):void {
imageXML = new XML(e.target.data);
ParseImages(imageXML);
Populates the arrays with the image values
and the text for each picture.
function ParseImages(imageInput:XML):void {
var iconList:XMLList = imageInput.image.icon;
var mainImageList:XMLList = imageInput.image.mainimage;
var descriptionList:XMLList = imageInput.image.description;
for (var i:int = 0; i < iconList.length(); i++) {
var imageElement:XML = iconList[i];
//trace(imageElement);
thumbnailArray[i] = imageElement;
for (var j:int = 0; j < mainImageList.length(); j++) {
var mainimageElement:XML = mainImageList[j];
//trace(mainimageElement);
bigImageArray[j] = mainimageElement;
for (var l:int = 0; l < descriptionList.length(); l++) {
var descriptionElement:XML = descriptionList[l];
//trace(descriptionElement);
descriptionArray[l] = descriptionElement;
loadImages();
function loadImages():void{
trace("inside of loadimages function.");
trace(thumbnailArray.length);
for(var i:int=0; i < thumbnailArray.length; i++){
trace(thumbnailArray[i]);
populateContainers(thumbnailArray[i], i);
//populateContainers2();
trace("Loaded " + thumbnailArray[i]);
var loader:Loader;
var xStart = -210;
var ypos = -34;
var currentPos = xStart;
var incrementValue = 66;
This takes in the name of the image file and
displays it within the newly created movie clip
function populateContainers(file:String, pos:int):void{
//create a movie clip to hold the image
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFFFFFF);
mc.graphics.drawRect(0, 0, 50, 51);
mc.graphics.endFill();
mc.buttonMode = true;
mc.x = currentPos;
mc.y = ypos;
mc.name = "thumb_" + pos;
mc.addEventListener(MouseEvent.CLICK, clickHandler);
loader = new Loader();
//loader.mask = imagemask;
var url:URLRequest = new URLRequest(file);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadInitialImage);
loader.load(url);
//add the image to the movie clip
mc.addChild(loader);
this.imageBar.addChild(mc);
//increment the currentPos
currentPos += incrementValue;
function clickHandler(e:MouseEvent):void{
var str:String = e.currentTarget.name;
var index:int = int(str.substr(6,1));
if(hasloaded) {
this.mainWindow.removeChild(loader);
loader = new Loader();
loader.load(new URLRequest(bigImageArray[index]));
this.mainWindow.addChild(loader);
TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeOut});
//setChildIndex(loader, 0);
hasloaded = true;
loadText(index);
function loadText(index:int):void {
Object(this).imageBar.txtdescription.text = descriptionArray[index];
function loadInitialImage(event:Event):void {
if(!firstLoaded) {
loader = new Loader();
loader.load(new URLRequest(bigImageArray[0]));
this.mainWindow.addChild(loader);
TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeIn});
//setChildIndex(loader, 0);
hasloaded = true;
loadText(0);
firstLoaded = true;
/* This section defines the buttons that control the image bar */
Object(this).imageBar.btnBarOpen.addEventListener(MouseEvent.MOUSE_UP, openImageBar);
function openImageBar(event:MouseEvent):void {
this.gotoAndPlay(1);
thank you!
Similar Messages
-
XML Driven Flash Photo Gallery Thumbnails Control
Hi, I need to make a XML Driven Photo slide in Flash CS5.
It needs to have a Box that contains 5 Thumbnails(by XML) act as buttons.
The Box sits on top of the Main photo area and shrinks (or close out) when user click its close button. And it opens out by clicking on a open button.
I'm sure it can be done by using timeline, Tweening or you name it..But what about the Thumbnails that run from the XML file?
Can they disappear with the Box and retrieve when it opens? is it possible?
If yes, what would be the best way to do that?
Any comment would be greatly appreciated!
Here is the ActionScript.
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.Event;
import fl.controls.Button;
import flash.display.Shape;
import flash.events.MouseEvent;
import flash.display.MovieClip;
import flash.display.Loader;
import flash.text.TextField;
import fl.transitions.*;
import fl.transitions.easing.*;
import flash.display.Shader;
var hasloaded:Boolean = false;
var firstLoaded:Boolean = false;
var barWidth:int;
var barHeight:int;
var images;
var imageCount:int;
var thumbnailArray:Array = new Array();
var bigImageArray:Array = new Array();
var descriptionArray:Array = new Array();
var xmlLoader:URLLoader = new URLLoader();
var imageXML:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("slideshow.xml"));
function LoadXML(e:Event):void {
imageXML = new XML(e.target.data);
ParseImages(imageXML);
Populates the arrays with the image values
and the text for each picture.
function ParseImages(imageInput:XML):void {
var iconList:XMLList = imageInput.image.icon;
var mainImageList:XMLList = imageInput.image.mainimage;
var descriptionList:XMLList = imageInput.image.description;
for (var i:int = 0; i < iconList.length(); i++) {
var imageElement:XML = iconList[i];
//trace(imageElement);
thumbnailArray[i] = imageElement;
for (var j:int = 0; j < mainImageList.length(); j++) {
var mainimageElement:XML = mainImageList[j];
//trace(mainimageElement);
bigImageArray[j] = mainimageElement;
for (var l:int = 0; l < descriptionList.length(); l++) {
var descriptionElement:XML = descriptionList[l];
//trace(descriptionElement);
descriptionArray[l] = descriptionElement;
loadImages();
function loadImages():void{
trace("inside of loadimages function.");
trace(thumbnailArray.length);
for(var i:int=0; i < thumbnailArray.length; i++){
trace(thumbnailArray[i]);
populateContainers(thumbnailArray[i], i);
//populateContainers2();
trace("Loaded " + thumbnailArray[i]);
var loader:Loader;
var xStart = -210;
var ypos = -34;
var currentPos = xStart;
var incrementValue = 66;
This takes in the name of the image file and
displays it within the newly created movie clip
function populateContainers(file:String, pos:int):void{
//create a movie clip to hold the image
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0xFFFFFF);
mc.graphics.drawRect(0, 0, 50, 51);
mc.graphics.endFill();
mc.buttonMode = true;
mc.x = currentPos;
mc.y = ypos;
mc.name = "thumb_" + pos;
mc.addEventListener(MouseEvent.CLICK, clickHandler);
loader = new Loader();
//loader.mask = imagemask;
var url:URLRequest = new URLRequest(file);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadInitialImage);
loader.load(url);
//add the image to the movie clip
mc.addChild(loader);
this.imageBar.addChild(mc);
//increment the currentPos
currentPos += incrementValue;
function clickHandler(e:MouseEvent):void{
var str:String = e.currentTarget.name;
var index:int = int(str.substr(6,1));
if(hasloaded) {
this.mainWindow.removeChild(loader);
loader = new Loader();
loader.load(new URLRequest(bigImageArray[index]));
this.mainWindow.addChild(loader);
TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeOut});
//setChildIndex(loader, 0);
hasloaded = true;
loadText(index);
function loadText(index:int):void {
Object(this).imageBar.txtdescription.text = descriptionArray[index];
function loadInitialImage(event:Event):void {
if(!firstLoaded) {
loader = new Loader();
loader.load(new URLRequest(bigImageArray[0]));
this.mainWindow.addChild(loader);
TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeIn});
//setChildIndex(loader, 0);
hasloaded = true;
loadText(0);
firstLoaded = true;
/* This section defines the buttons that control the image bar */
Object(this).imageBar.btnBarOpen.addEventListener(MouseEvent.MOUSE_UP, openImageBar);
function openImageBar(event:MouseEvent):void {
this.gotoAndPlay(1);thank you!
-
Flash-driven web photo gallery in Contribute
I created a flash-driven web photo gallery in LightRoom. I'm
trying to insert it in Contribute to post on my website but
Contribute won't recognize the file. Any suggestions as to how to
insert this photo gallery on Contribute?
Miguel54From what I understand on the internet, a lightroom gallerie
is build with more files than just one swf. Have you checked this
and made sure that these are on the server?
Post:
http://blog.deconcept.com/swfobject/forum/discussion/944/lightroom-jsswf-drupal/ -
Hello,
I am a photographer interested in designing a photo gallery
website.My question is how are the special effects created in Flash
for when a thumbnail is clicked and the photo downloads into the
picture viewer? (such as the photo fading in , the photo is
assembled from small blocks, the photo downloads from left to
right, the photo downloads after a flash of light) Is there a name
for these effects? Thank you so much, WendyWonderwendy wrote:
> Hello,
> I am a photographer interested in designing a photo
gallery website.My
> question is how are the special effects created in Flash
for when a thumbnail
> is clicked and the photo downloads into the picture
viewer? (such as the photo
> fading in , the photo is assembled from small blocks,
the photo downloads from
> left to right, the photo downloads after a flash of
light) Is there a name for
> these effects? Thank you so much, Jim
These are some complex components/files you can get free off
the net:
http://www.sephiroth.it/file_detail.php?id=139
ImageGallery 3
http://www.sephiroth.it/file_detail.php?id=135
Photo Album
http://www.sephiroth.it/file_detail.php?id=124
Image Fader
This particular sample is the closets to what you are looking
for. It is XML
driven so all the files information can be edited w/o
changing the Flash movie.
You can define 9 transitions along the image name and the
rest happens automatically.
There are many more samples online, search for stuff like
"flash photo gallery"
or "flash gallery", some free some shareware but definitely
plenty.
Best Regards
Urami
!!!!!!! Merry Christmas !!!!!!!
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Flash Photo Gallery Image Rollover Help
Ok I was wondering if anyone could help me with this I have
created a flash photo gallery which reads from an xml file. It uses
the following action script
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++) {
this.picHolder = this.firstChild.childNodes
this.thumbHolder =
thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbLoader =
this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
myPhoto.load("xmlphoto.xml");
I want to add in a rollover effect to the gallery similar to
the one in Flash Gallery 1 in photoshop
http://www.adobe.com/support/downloads/detail.jsp?ftpID=2961
Would it be possible to take one of the as files from the Flash
Gallery source and intergrate it into my gallery or would I be
better just adding the rollover effect myself?the thumbnail (or its unique parent if you setup this up
without fore-thought) should be a movieclip that stores a reference
to the larger image's path.
search google for flash gallery tutorial. there are bound to
be lots of tutorials. -
Photo Gallery thumbnails in business catalyst render in different sizes in different browsers
Photo Gallery thumbnails in business catalyst render in different sizes in safari and chrome but are fine in firefox. What is the issue with Safari? I have tried the different algorithm options such as fill_proportional etc and firefox is the only browser that displays correctly. I thought safari was the most standards compatible browser - what's the problem here?
Hi,
If you have seperate XML file but with the same basic structure then you can change the XML a Spry dataset refers to and regenerate the spry region without reloading the full page.
So on my photo gallery page I can change the album the photos are shown from via the seturl sprydata function as below. dsPhotos being my Spry dataset that points to the relevant XML dataset with my image references and captions etc. My XML is actually dynamically generated from Picasa RSS feeds (and RSS feeds are XML) but the principle will be the same with your static XML.
First I add an event listener for when someone clicks on an album (the li tag within my div with the id "albums" holds a photo and title for each album.)
function Albums()
var myalbums = Spry.$$("#albums li", "TabbedPanels1")
var rows = dsAlbums.getData();
var setListener = function( element, value )
Spry.Utils.addEventListener( element, "click", function(){ showAlbum( value ); },false );
for( var i = 0, length = myalbums.length; i < length; i++ )
setListener( myalbums[i], i );
Then this is the code which changes the photo album to be shown. (when the user clicks the relevant album)
function showAlbum(i)
pauseShow();
pImage = 'No';
var rows = dsAlbums.getData();
var albumid = rows[i]["albumid"];
var url = "xml/PicasaAphotoFeed.asp?albumid=" + albumid;
dsPhotos.setURL(url);
dsPhotos.loadData();
var rowcount = dsAlbums.getRowCount() - 1;
var nextalbum;
var navnext;
var n;
The page is here www.thehmc.co.uk/photo5.html is you want to see it in context.
In your case showAlbum would switch between Frank.xml or Wolfie.xml depending on how you decide to name your xml datasets.
Regards
Phil -
Flash not displaying photos in Flash photo Gallery
I have several web sites that use a flash photo gallery to display the photos. All worked until a few months ago when the photo were not displayed to users who used Mozilla Firefox, or MAC users using Safari for their browsers. The albums were blank, the thumbnails were blank. Yet if you used Google Chrome or Internet Explorer, all photos displayed perfectly. I have been to the Firefox forums and they point to Flash. I was using Flash 11.5.502.146, then I downgraded to Flash 10.3. To my surprise all photos display now on my Firefox browse V18.0. So there is definitely a problem with the newer Flash displaying photos in a flash gallery. What can be done to fix this?
report the bug: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
-
Flash Photo Gallery Template 3 for CS2
I am trying to build a flash photo gallery using template #3
from Photosho CS2. I can not figure out where in the scripting the
wmode=transparent param goes. The swf is embeded using a script.
gallery is located here:
http://www.depasqualeacademy.com/jay/photo_gallery
I tried to contact Chopping Block, but they do not support
the template and Geoff Stearns no longer works there.
please help-
[email protected]This is all one great learning experience, kevin.
Just jump into the cold water and soon you will be swimming.
First try to load any pictures at all, later deal with the
thumbnails, even later with greyed out and so on.
Start here:
http://www.kirupa.com/developer/mx2004/xml_slideshow.htm
Then go here:
http://www.kirupa.com/developer/mx2004/thumbnails.htm -
Adding a Flash photo gallery on DW
So, I'm trying to add a flash photo gallery on my site. I am very new to this and cant seem to figure out how to do it exactly.
I've found free templates online and downloaded the files. But I am unsure where to go from there. Like I said, I very unexperienced with this program, I did find the add flash option, but am unsure which files to add.
Any help would be greatly appreciated!
Thank youHi
The documentation confirms what I have written in my previous post it is controlled by an xml file.
Copy all the files required as indicated by the documentation into the required folder and open the gallery.xml file in dreamweaver.
Insert the images file locations into the xml file as indicated in the example. Important - the location of the files MUST represent where they would be if referenced from the html page you are inserting the image gallery into.
This means that it is probably better if you create the xml file in the same file position as the html page and the copy this file into the required position in the gallery folder that they suggest you create.
PZ -
Coffee Cup Flash Photo Gallery
Hello Everyone,
Do you know, if Coffee Cup Flash Photo Gallery works within a
Flash website. Has anyone used any
CoffeeCup software with FLash CS3?
Thanks for your help!
Franchelle"ImagicDigital" <[email protected]> a
�crit dans le message de
news: e54tsr$qit$[email protected]..
> Check out SlideShowPro:
>
>
http://www.slideshowpro.net/
>
> It's very classy and malleable. You can set up the
original XML file and
> then your client can edit it in a simple text editor to
add, swap, or
> caption images. I think it's around $20.
Wahou ! Very nice !
Do you know other extensions (not only photo galleries) of
this quality ?
seb -
NEWBIE: Flash photo gallery! Images are pixelated:(
Greetings everyone. I created a Flash photo gallery using
gifs. While most of the images are acceptable visually, a bunch of
them are quite pixelated.
I read online that I am supposed to use vector graphics
whenever possible, but not all images where created as vector
graphics.
I have a few questions:
If I create the image in illustrator, what format should I
save it as to be used in a Flash gallery? If I create the image in
Photoshop what format should I save it as?
Lastly, is it true that Flash will load vector graphics
quicker than gifs?
Any info would be appreciated! Oh yeah, my site is
inthemixgraphics.comif you create an illustrator file, actually drawing with the
tools rather than just importing a bitmap and exporting it again,
it will indeed give you a vector file you can work with. you can
even export it as images that are readable by flash-- however,
you'll get the best looking stuff if the vector is basically
rewritten in flash. Import a (dot)eps file into flash, and break it
apart. Look at how the objects maintain their shape.
Now publish the thing and look at the bandwidth viewer. Is
the filesize much smaller than if you imported the .jpg? It should
be, but at least there is a way to check it.
I get the most pixalation from images when I'm forced to
scale .png's down by less than a perfect %. Its weird.
If you're loading externally, I'm not entirely sure the
correct process to bring an optimized vector in, as my thoughts are
that it would be the actual size of the .eps image (or .swf if you
can export to that) itself.
--I hope this makes some sort of sense, and if it doesn't
you'll have to forgive me.
HmcH. -
Inserting a flash photo gallery in a column
Hi
I usually work with frames but I now started a new site using
the default HTML 2 columns template. One of the columns will hold
my main content. I'm trying insert a flash photo gallery in the
column but this gallery (SimpleViewer) has its own index.html file.
Is this possible and how can I do it?
Thanks!Hi Anthony:
Have you tried simply applying iMovie's 'Flash" effect to the slug?
Sue -
Anyone know if there is a free flash photo gallery extension available?
If not an extension then maybe an application to create a flash gallery to upload to website?
Thanks
AndyHey Boss DJ
Thanks for that - just what i was after :-)
Andy -
IWeb Flash Photo Gallery?
I would like to embed a flash photo gallery into iWeb using the HTML snippet. Can anyone recommend good flash photo gallery software that works well with iWeb?
Simpleviewer and its siblings are available here...
http://www.airtightinteractive.com/viewers/
The flash album exporter for iPhoto is here...
http://flashalbumexporter.home.comcast.net/~flashalbumexporter/iphoto/iphoto.htm l
You could also look at shareware applications like....
http://www.verticalmoon.com/products/swfnslide/swfnslide.htm
... and its Pro version. -
Customise button wording for 'NEXT' that appears with Photo Gallery Thumbnails
Is it possible to customise the wording of the 'NEXT' button that appears with the photo gallery thumbnails? ie, if you only have 5 thumbnails on page, but the gallery has more pics, a NEXT button is generated, but we'd like it to say MORE IMAGES instead....
thank you!
Maybe you are looking for
-
Calendars and events are missing from iCal
What happened was I closed the lid of my MacBook Pro to put it to sleep. When I opened the lid to wake it, the screen was dark, like it was between 0 brightness and the lowest brightness setting. It also was not responding to trackpad or keyboard inp
-
Solution Manager 4.0 SR1 on iseries - Error on step CallOfflineCTC
I'm installing a Solution Manager 4.0 SR1 on iseries using SAPinst/TMKSRV from Windows XP client. In the step Configure UME the installation stopped. As describe in SAP note 927734 I changed the control.xml in the SAPinst directory with the control.x
-
Boot Camp - Windows Switching Utility?
I saw a utility called "Boot Champ" that was designed to allow you to boot windows from Mac OS without shutting down and using the option key. I wasn't very impressed with the utility... are there any other utilities that have the same properties tha
-
Unable to open CR2 photo files in photoshop CS6
I am not able to open my CR2 files (from a Canon 70D camera) in my Photoshop CS6 via camera raw. The pop up window suggested updates, which I did, and the problem persists. Any suggestions?
-
Hi Experts, i want a UDF of 3000 characters. but the max size of UDF is 254. how i can do this. Thanks & Regards Manoj Sourot