Gallery Tut: End Of Gallery, Making NEXT Button Disabled
Hi all,
i've been looking at the XML photogallery tutorial and was thinking, is there a way to set the PREVIOUS and NEXT buttons to be disabled/invisible on the FIRST and LAST images in the gallery respectively?
This would be fantastic if I could do it, but I can't, so I'm crying for some help now!
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 01-07-2005, 09:56 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Gallery Tut: End Of Gallery, Making NEXT Button Disabled
Hi all,
i've been looking at the XML photogallery tutorial and was thinking, is there a way to set the PREVIOUS and NEXT buttons to be disabled/invisible on the FIRST and LAST images in the gallery respectively?
This would be fantastic if I could do it, but I can't, so I'm crying for some help now!
Keeping A Disabled Button Disabled After Navigating Away From The Frame
Okay, so... I'm making a VERY basic Jeopardy game, and I need buttons to be disabled after being clicked on once.
Oh, and I'm working in CS3, but I'm using AS 1&2 because that's what I learned... I have no idea how to use AS 3...
example:
frame 1 has btn11 in it. btn11 when clicked takes the person to frame 2. when done with frame 2, they click on return.
the return button (btnReturn1) has the following AS
on (release) {
gotoAndStop ("Round1",1)
btn11.enabled=false;
}
the problem is that it works at first - the button disables when I get back to frame 1, but the next time I click a different button then return to frame 1, the first button I disabled isn't disabled anymore.
can you help me fix my actionscript so that my disabled buttons stay that way no matter how many times I come and go from the frame? or if you have a better way to do it, that'd be great. basically, it's like the jeopardy screen, and after "songs" for 200 is clicked, I don't want it to be clickable again at all.
Making A Gallery
could somebody give me a little help please
the easiest way to see my problem is to go www.thenewpotato.co.uk and choose level one and photography from the comboboxes, the site is to have a number of galleries but this is the only one present currently. i want to use the scroller to choose the image on display, the method used for each part is as follows
the scroller is from a tutorial on this site
http://www.flashkit.com/tutorials/I...m-909/index.php
and the image loader comes with MX as a sample. I have been able to make the buttons in the scroller change the variable that influences which jpg is loaded, but the picture doesnt actually then load. I have been able to make a button outside of the scroller that will load a specific image, but i really would like to be able to select each image from their thumnail in the scroller.
Any ideas greatly appreciated.
Making A Web Gallery
I really want to create a web gallery....I am not sure how to create one does anyone have any suggestions on readings or tutorials..........
On Making A Flash Art Gallery
I'm just wondering, are there any comprehensive tutorials online that teach you the basics of making a webpage using flash 5 for newbies? I've been trying to play around with it, but I just seem to be such a dunce at it >< Could anyone please help? Thanks a bunch.
Waelinh.
Making A Very Bespoke Xml Gallery
Hello people :-)
Having come up with a new design for my friend's jewellery website that I'm building in xhtml and CSS, I've decided to go for flash for the gallery in order to keep it fully updatable.
Mock up design here
There are eventually going to be many categories and new items of jewellery added on a fairly regular basis, hence the need for scrolling on both the categories and the thumbnails sections. Each section, sub section etc would need to be infinitely updatable (within reason!)
Now I've built really simple xml galleries before, nothing on this scale. Perhaps someone could point me in the direction of a tutorial for a gallery similar to this one? It would have to be almost identical for me to be able to be able to adapt it to my design as I just don't have the in depth knowledge of this stuff to make massive additions or changes and i'm really pushed for time. Was thinking maybe there's some kind of template around I could adapt - I've done countless searches on this type of thing but can't find anything similar enough! Or maybe even someone here could have a go at it for a fee?!!
Hopefully it's clear enough from the jpg what needs to happen and where...
Any suggestions very much appreciated!
Pat
Making A Crazy Xml Gallery
http://www.kirupa.com/web/xml/examples/portfolio.htm
into
www.crashmedia.com
Im just wondering roughly how this can be done.
Making A Crazy Xml Gallery
http://www.kirupa.com/web/xml/examples/portfolio.htm
into
www.crashmedia.com
Im just wondering roughly how this can be done.
Help Making A Picture Gallery With Discription
What Im tring to do is make a picture gallery that loads a dynamic text file for every picture (.jpg). I can get the viewer to load a Text file and a picture But I cant get it to load the txt file that goes with the picture. Example of what I would like to do. If you open image1.jpg I would like it to open text1.txt also. IT will have 2 dynamic windows 1 for txt and one for images. If you could help me with the script I would be thankful
Making Thumbnail Gallery Getting Error
Hey Guru's,
I have a little problem, I created a thumbnail loading image (via frame labels inside of movies) for someone, and now I am creating one for a friend the exact same way so I copied the code and just changed the name of the frame and movie labels... its giving me a syntax error with this new one however, the one i copied from works fine.. here is what I have...
on (press){
_root.2000_Movie.gotoAndPlay("2000_image1");
}
the only things I changed were the name of the movie and the frame label! why isnt it working on the new one...
What I did is created a movie insdie the scene with 10 images (1 image per frame) and put a stop and a frame label of "2000_image#" Therefore when I roll over my button on the root timeline it will load the image from the movie (that is also sitting on the root timeline) the correct image would appear.. I am using flash mx 2004.. any ideas?
Thanks,
Andy
Real Newb - Making A Gallery
Hi everyone
I've been a browser here for a while but this is the first time i've needed some desperate help for a project.
What i am doing is making a gallery for a shockwave presentation. I want the thumb nail as black and white, when you roll over i want it to fade to colour and then when you click on the thumb it will enlarge to fill the page.
I have made - The mc of black to coloured
- The mc of coloured to enlarged coloured.
- Have all related images converted to the graphic symbols i need.
I've tried putting the mc's into a button but when i test the movie it has no rollover or click effects. I have a feeling i will need to action script to make it stay enlarged after click but i'm no good at scripting (i usually stick to just making buttons in flash )
I hope i have made my issue clear. I am using Flash CS3 and i have it set to Actionscript 2.
Any help would be appreciated
Help Making Photo Gallery Random
Hi All,
I'm trying to figure out how to make my photo gallery load the images randomly each time. I'm a beginner at flash so don't know too much about actionscript. If someone could take a look at my code and tell me how to modify it to do this, that would be great! Thanks so much!
my actionscript:
Code:
this.pathToPics = "http://www2.cybergolf.com/sites/images/347/";
this.pArray = ["winchester.jpg", "aliante.jpg", "angelpark.jpg", "dalhousie.jpg", "theduke.jpg", "highmeadowranch.jpg", "indianwells.jpg", "lagunadelmar.jpg", "thelegacy.jpg", "lincolnhills.jpg", "longbow.jpg", "phantomhills.jpg", "sandia.jpg", "somerby.jpg", "threecrowns.jpg", "tijerascreek.jpg", "wekopa.jpg"];
this.fadeSpeed = 20;
this.pIndex = 0;
MovieClip.prototype.changePhoto = function(d) {
clearInterval(id);
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() {
var p = this.photo;
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
id = setInterval(this, "changePhoto", 10000, 1);
this.onEnterFrame = null;
}
};
//start everything
changePhoto(0);
Making A Gallery With Descriptions Xml Driven
is there a tutorial on making a gallery of buttons with titles and then once you click on them you will get details about that specific item.. i am playing around and i got 50% of it working but its taking forever
Need A Little Help Making A Flash Xml Photo Gallery With Thumbnails
Right I need a lot of help with this. I'm trying to make an xml photo gallery in Flash CS3 and I'm getting nowhere fast. Hears what I have http://thedesignport.com/Portfolio_Page_One.html
You'll see an orange dot on the right hand side roll over it and you'll see the menu pop out. Now I need all the thumbs and the big images to load dynamically and have a image counter working ie click the right arrow to move to the next image and so on. Anyone got any ideas?
Thanks all!
Making Kirupa's Scrolling XML Gal Multi Gallery
Hi everyone,
I would like to know how difficult it is to adapt the XML gallery below into a multi gallery.
http://www.kirupa.com/developer/mx2004/thumbnails.htm
I have tried to adapt some of the other galleries posted here but I keep getting stuck as the actionscript is beyond me.
I can follow along with this one but I would like to adapt it for my portfolio site so that I can have different buttons that when clicked on will load in new thumbnails.
Is there a tutorial I can follow? preferable nothing which involves to much actionscript. Just something simple that I can attach to every new button to bring in new thumbnails. Or can someone please explain.
Thanks
Making A Photo Gallery Inside A Flash Interface
To anyone who can help:
I currently have a website that has over 75 photos in 5 different categories. I can design the interface and buttons etc., but I don't know how to go about displaying each picture without loading all of them into the movie. That seems a bit excessive. Is there a way that I can just call the .jpg file into the interface's "window"?
Essentially it would be layed out as such:
Initial interface with buttons to each category
Click on category to get thumbnails
Click on thumbnail to see larger image
Have a forward and back button to go to next photo instead of going back to the thumbnails.
Is there a way to do this without overloading the movie?
Any help is appreciated since it seems there are virtually no resources for this type of thing anywhere on the web.
Thank you in advance.
dnotenshi
PS I have Flash 5
[F8] Making Dynamic Image Gallery Masking Problem
I am making a basic gallery. Loads x amount of images into a certain size of frame. The problem is the way I did it now is I made a movieclip inside my frame and named it masker and size it to the size I wanted the objects masked. Then each time I add a new movieClip to the gallery I call the setMask function. Now this works perfect for the first one that goes over the edge, half is in the frame, the other half you can't see. The problem comes when I add the next one, it removes the mask from the previous one so you can see all of the previous one. I am sure this is just an amature bug, please let me know the correct way to approach this situation.
Making Actionscript Photo Gallery Fade Automatically
Hey all,
Hopefully this hasn't been covered a lot here... I'm a newbie when it comes to ActionScript so hopefully someone here can help me out.
I've been using this kirupa designed flash photo gallery because it's far more efficent size wise than just creating the tweens in flash:
http://www.kirupa.com/developer/mx/photogallery.htm
My question is this:
What is the best way to change this photogallery so that rather than manually changing the photos with a button, it will fade them in and out automatically?
(i.e. on (release) {
_root.changePhoto(1);
} )
I tried wiring it up using "onEnterFrame" as a function to change _root.changePhoto but maybe I'm placing the code in the wrong place because I can't seem to get that to work.
Any help with this would be greatly appreciated.
[flash8]Making XML Photo Gallery Full Screen
I've mixed and matched the xml photi and slideshow galleries, along with adding a slideshow on/off button and another button to hide/show the thumbnail bar.
I'm struggling with 2 things:
1) Full Screen.
I've used the code from here to create a button to go to full screen:http://www.bezzmedia.com/swfspot/tut...een_Flash_Mode
Code:
//Don't scale the movie when the stage size changes
Stage.scaleMode="noScale";
//Align the stage to the top left
Stage.align = "TL";
//Function to toggle between fullscreen and normal size
//the toggle fullscreen button calls this function when pressed
function toggleFullScreen(){
//if normal size, go to fullscreen, else go to normal size
if(Stage["displayState"]=="normal"){
Stage["displayState"]="fullScreen";
}else{
Stage["displayState"]="normal";
}
}
//Create a listener for each time the Stage is resized
var resizeListener:Object = new Object();
//Called each time the stage is resized
resizeListener.onResize = function () {
//Move the button to the center of the screen
toggleFullScreenButton._x=Stage.width/2;
toggleFullScreenButton._y=Stage.height/2;
}
//Add the listener to Stage
Stage.addListener(resizeListener);
Now toggleFullScreenButton._x etc are applied to the (full screen) button to center it, but obviously I want to center everything. This really just centers a movie clip that is the button.
Any ideas on the way forward? I could try just generating my SWF and then loading it in a new MC and centering that (although I'm not 100% certain how to do it). I'd prefer to do it in the original file if possible.
2) Borders. Try as I might I can't get the borders tutorial to mix into this one. Any good links greatly appreciated.
Scottys Resize Gallery The Gallery With Thumbnails And Multiple Galleries Problem
Hi all,
I'm relatively new to flash and was looking through the forums and found Scottys cool resize gallery which i am trying to implement in a dreamweaver website.
This is probably a stupid question but i was wondering if anyone could tell me how to add in a fifth gallery to the program - i'm probabaly doing something stupid but i can't seem to access the actions panel at all to look through the code??
Any help would be greatly appreciated!!
Also, does anyone know if this gallery will take forever to load onto a webpage or will it load relatively quickly!??
Thanks a mil in advance
Derm
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....
Making His SlideShow Gallery Have Pause, Prev, Next, Play Buttons - Without Skipping
Hi,
I went through a list of post discussing different modifications to the slideshow and photo gallery tutorials but i didn't read of anyone trying to combine slideshow and photo gallery functionality. The slideshow is driven by an onEnterFrame and loops through how ever many number of images (nodes in the xml) and then displays them automatically..but the photo gallery script advances (prev or next) based on onRelease events of the key press or click of the buttons.
However, I was trying to combine both and noticed immediately that while in the onEnterFrame ..if pressing the next button a couple of times...the count gets messed up and the slideshow advances really quickly for however many number of times you have clicked (prev or next)...if once..you may not notice...but if twice...(i.e. on 2 and clicking twice to 4..then it jumps to 6..then 8..etc..)..for larger sequences of clicks..you notice..4..8..12..16..
I was wondering what would be a good fix for this..
considering both prevImage() and nextImage() functions determine how p is controlled before calling the slideshow() function?
//nextImage function
Code:
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
slideshow();
}
}
}
//Slideshow function
Code:
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
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?
Photoshop CS2: Web Photo Gallery: Flash - Gallery 1
I'm interested to know the code that Adobe Uses with one of their Web Photo Gallery (Photoshop CS2) - it's the one called "Flash - Gallery 1".
Here's a sample of it:
http://www.newrisedesigns.com/charlie/060416/
What I'm interested in, is how to do the thumbnails...when you roll over them - they move all of the other thumbnails around - and also show the name of the external jpg file.
Anyone know or have the source code to do that? What about any kind of tutorial out there that can do this?
Help please?
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.
Thumbnail Gallery Tutorial - Gallery Within Movieclip
I've taken the Adding Thumbnail tutorial http://www.kirupa.com/developer/mx2004/thumbnails.htm and it works perfect. However when I play the photogallery swf file within a movie clip (playing as externail swf from main timeline) and the gallery pulls up. The links work and all is good. All until I try and scroll to more thumbnail files. It's now scrolling. Scrolls fine when swf played indendently.
This couldn't have come a worse time as my finals are due in hours.
Please help if you can.
Thanks
Populate The Multi-Gallery Ver. Of Josh's Gallery From A Db?
I'm getting a little lost in all the technologies available. I would like to have the actual buttons for the multi-gallery version of Josh's gallery (it's in his original post, about half way though) to be populated by my db, for the 'entire site' version of a photographer's homesite I am building, to be available for all when it's done (i.e., it will be entirely open source and free). I have a LOT to learn. For now, I have a db, and also within the original post, someone wrote a php script to generate the xml from a db, using PHP, which I was lucky that someone converted to ColdFusion for me. And it led me to think...is there anyway the actual gallery buttons cal be populated on the fly based on my db such that anytime the page is loaded, it reads the db and loads the proper buttons? I guess a similar approach would work...put the gallery names and id's into a db, have a script to convert the galleries into an exl file (i.e., where it currently is an 'album' node in the multi-gallery version, and read that and populate the gallery appropriately. Read the albums available from the script, and populate the buttons accordingly, is what I'm trying to say. I can show you an example of where I'm going with Josh's gallery, which has been a god-send for me (I owe this man BIG TIME) but it's, as usual, a work in progress: http://shawngibson.com/faceitphoto.c...ii/index2.html The buttons (under portfolio)...the main page is blank cuz I've no idea what she would want as an intro)...are hard-coded to the xml (you manually add them as per the original, not changed anything yet, and only thefirst 2 are coded I think), but I'd like them to be based on a db because that php script seems to offer me the chance to load the galleries themselves dynamically. It will be HOPEFULLY based on ColdFusion, but right now I can do either CF or PHP, because I can pay someone to do the conversion if necessary. I loathe PHP because I can't for the life of me make sense of it, CF is much easier to try and understand. Are any of you inclined to help with this? I am lost with the whole remoting thing. It will be an open-source project for all to have, with all proper credits when it's done. Currently, I'm using my best friend as my testing bed - it's her gallery I'm trying to build. If this is clear as mud, please let me know. Shawn
Problem Loading Thumbnails From Gallery To Gallery
Hello,
I've finally published our site (many thanks to all that helped from the forum).
I have two problems :
First: It was just brought to my attention that the site doesn't load in IE. I believe this is an html thing.
Second: I have multiple galleries that load from different points in the timeline.
But if you scroll the thumbnails in one gallery then click to another gallery. It doesn't load the thumbnails from the first thumbnail but from around the same point the last gallery was left. (I hope this makes sense).
Anyways I need the thumbnails to load at the start every time.
Any thoughts??
thanks
Converting This Photo Gallery To A Video Gallery
I have made an attempt at converting the below referenced Photo Gallery to a Video Gallery and need help with two things:
1. Have the FLVComponent call the video from an XML file
2. Move the Title from the top to the underneath the Thumbnails when the mouse hovers over
The FLA project can be downloaded from:
hxxp://members.cox.net/dgtlmik/Video_Gallery.zip
Thanks in advance!
Photo Gallery = Video Gallery?
hi
I was just wondering if it would be possible to show video files with some modifications in photo gallery?
Please post what you know...(format etc.)
Thx
LF...
Photo Gallery = Video Gallery?
hi
I was just wondering if it would be possible to show video files instead of jpgs with some modifications to XML photo gallery?
Any clue?
Thx
LF...
Project Gallery...not Just Photo Gallery
Project gallery...not just photo gallery
Hello, I'm looking for a project gallery. The projects could be for example, websites.
I want the list of projects down the left side. When you click one an image of the project pops up to the right AND below the image would be the description of the project, which pops up at the same time.
I've see photo galleries that kind of do this, but not a project gallery. Emphasis is on both the photo and description.
Any demos available or thoughts?
Thanks.
Gallery On A Button In A Box
i've got a page with a dominant graphic and to the left two separate boxes, one with scrolling text (thx to Patricks tut) and above a box i want to place a few photos that will come up as requested (button/gallery style 1/2/3 etc) the button that triggers this scene presumably will have to load these fotos ready to be selected. Seemed really easy in concept but think i could do with a bit of help for it? Anyone help pls?
Xml Gallery From Button?
I have got a pre-exisitng button which i have animated and wanted for the button to be a link to an image which operated from an xml gallery into a loader, could anyone help with the coding, what code would i add to the button and what code to add to actions layer?
I havn't used any xml yet and am still learning!
Cheers
Help With XML Gallery Next Button
Hello I'm trying to add next and previous buttons to an XML photo gallery. Here are the as files so far.
the initial variables
ActionScript Code:
var ext_thumbs:MovieClip = new MovieClip();
addChild(ext_thumbs);
var extPicArea=new MovieClip();
addChild(extPicArea);
extPane.source = ext_thumbs;
var fadeIn:Tween;
var urlVar:String="ext.xml";
var picturePathList:Array = [];
var thumbPathList:Array = [];
var pictureTitleList:Array = [];
var pictureDescList:Array = [];
var totalPics:Number;
var extPicPlacementX:Number;
var extPicPlacementY:Number = 20;
var c:Number = 0;
var xSpacing:Number = 55;
var ySpacing:Number = 55;
var xs:Number = 0;
var ys:Number = 0;
var thumbRowCount:Number = 40;
loadTheXML();
loading the XML
ActionScript Code:
function loadTheXML(){
var xmlURLLoader:URLLoader = new URLLoader();
var xmlURLRequest:URLRequest = new URLRequest(urlVar);
xmlURLLoader.load(xmlURLRequest);
xmlURLLoader.addEventListener(Event.COMPLETE,sortTheXML);
function sortTheXML(event:Event):void{
var theXMLData:XML = new XML(xmlURLLoader.data);
var a:Number = theXMLData.picture_path.length();
totalPics = a;
var b:Number = 0;
while (b < a){
picturePathList.push(theXMLData.picture_path[b]);
thumbPathList.push(theXMLData.thumb_path[b]);
pictureTitleList.push(theXMLData.picture_title[b]);
pictureDescList.push(theXMLData.picture_desc[b]);
b=b+1;
}
var randomNum:Number = Math.round( Math.random()*(totalPics - 1) );
var extLoader:Loader = new Loader();
var extRequest:URLRequest = new URLRequest ( picturePathList[randomNum] );
extLoader.load( extRequest );
extLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, extLoaded);
function extLoaded(event:Event):void{
extPicPlacementX = ( stage.stageWidth/2) - (extLoader.width/2);
extPicArea.x = extPicPlacementX;
extPicArea.y = extPicPlacementY;
fadeIn = new Tween( extPicArea, "alpha", None.easeNone, 0, 1, 15, false);
extPicArea.addChild(extLoader);
loading the thumbnails
ActionScript Code:
function loadTheThumbs(){
var thumbLoader:Loader = new Loader();
var thumbRequest:URLRequest = new URLRequest (thumbPathList[c] );
thumbLoader.load(thumbRequest);
thumbLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, whenThumbsLoad);
function whenThumbsLoad(event:Event):void{
var thisThumbsLink:String = picturePathList[c];
thumbLoader.x = (xs * xSpacing) + 5;
thumbLoader.y = (ys * ySpacing) + 5;
xs = xs+1;
if(xs==thumbRowCount) {
xs = 0;
ys = ys+1;
}
thumbLoader.addEventListener(MouseEvent.CLICK, loadExtPic );
function loadExtPic(event:MouseEvent):void {
thumbLoader.removeEventListener(MouseEvent.CLICK, loadExtPic );
extPicArea.removeChildAt(0);
var extLoader:Loader = new Loader();
var extRequest:URLRequest = new URLRequest ( thisThumbsLink );
extLoader.load( extRequest );
extLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, extLoaded);
function extLoaded(event:Event):void{
thumbLoader.addEventListener(MouseEvent.CLICK, loadExtPic );
extPicPlacementX = ( stage.stageWidth/2) - (extLoader.width/2);
extPicArea.x = extPicPlacementX;
extPicArea.y = extPicPlacementY;
extPicArea.addChild(extLoader);
fadeIn = new Tween(extPicArea, "alpha", None.easeNone, 0, 1, 15, false);
}
}
ext_thumbs.addChild( thumbLoader);
c=c+1;
if(c<totalPics){
loadTheThumbs();
extPane.update();
}else {
xs = 0;
ys = 0;
c = 0;
extPane.update();
trace("done loading thumbs");
}
}
This next one is for the next button and it is the one I'm having trouble with
ActionScript Code:
extNext.addEventListener(MouseEvent.CLICK,nextPhoto);
var nextExtPhoto:String = picturePathList [c] ;
function nextPhoto(event:MouseEvent):void {
extNext.removeEventListener(MouseEvent.CLICK, nextPhoto );
extPicArea.removeChildAt(0);
var extLoader:Loader = new Loader();
var extRequest:URLRequest = new URLRequest (nextExtPhoto)+1;
extLoader.load( extRequest );
extLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, extLoaded);
function extLoaded(event:Event):void{
extNext.addEventListener(MouseEvent.CLICK, nextPhoto );
extPicPlacementX = ( stage.stageWidth/2) - (extLoader.width/2);
extPicArea.x = extPicPlacementX;
extPicArea.y = extPicPlacementY;
extPicArea.addChild(extLoader);
fadeIn = new Tween(extPicArea, "alpha", None.easeNone, 0, 1, 15, false);
}
}
I'm not sure how to move the URL request to the next photo in the array. Right now when I test it the swf loads fine, but when I push the next button I get this error:
Quote:
Error #1034: Type Coercion failed: cannot convert "[object URLRequest]1" to flash.net.URLRequest.
at extgallery_fla::MainTimeline/nextPhoto()
Any help would be appreciated. I'm a beginner at this stuff and I'm in over my head.
Thanks
My XML Gallery Needs Next Button
I have an xml galler which pulls my images in and sets them in coloumns of three what I need is a next button in my thumbnail movie clip which takes in the next set of images after 5 coloumns have loaded.. "if that makes sense"
in my thumbnail mc I have this action script which loads my thumbs
Quote:
images = new Array ();
xml_file = ("wheels/limited/images.xml");
//xml_file = "images.xml";
xmlload = new XML ();
xmlload.ignoreWhite = true;
xmlload.onLoad = function (ok) {
if (ok) {
count = this.firstChild.childNodes.length;
for (var i = 0; i < count; i++) {
curNode = this.firstChild.childNodes[i];
images[i] = {caption:curNode.childNodes[0].firstChild.nodeValue, path:curNode.childNodes[1].firstChild.nodeValue};
}
boot ();
} else {
trace ("Could not load " + xml_file + ".");
}
};
xmlload.load (xml_file);
// ------------------------------------------------------------
spacing = 2;
var columns = 3;
boot = function () {
for (var i = 0; i < images.length; i++) {
mc = container.attachMovie ("thumbMC", "thumb" + i, i);
mc._x = (i%columns)* (80+spacing);
mc._y = Math.floor(i/columns)*(80+spacing);
mc.path = "wheels/limited/thumbs/" + images[i].path + ".jpg";
mc.link = "wheels/limited/images/" + images[i].path + ".jpg";
mc.caption = images[i].caption;
}
this._parent.picture._alpha = 0;
this._parent.caption._alpha = 0;
this._parent.picture.loadMovie ("wheels/limited/images/" + images[0].path + ".jpg");
this._parent.caption.txt = images[0].caption;
setRollOver ();
};
any idears please
Next Button Xml Gallery
I am trying to add a next button to an xml photo gallery. I can't figure out which variable expresses the current xml node associated with the main photo. This function should load the new photo fine.
Code:
extNext.addEventListener(MouseEvent.CLICK,nextPhoto);
function nextPhoto(event:MouseEvent):void {
extNext.removeEventListener(MouseEvent.CLICK, nextPhoto );
extPicArea.removeChildAt(0);
var extLoader:Loader = new Loader();
var extRequest:URLRequest = new URLRequest (I don't know what goes here)
extLoader.load( extRequest );
extLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, extLoaded);
function extLoaded(event:Event):void{
extNext.addEventListener(MouseEvent.CLICK, nextPhoto );
extPicPlacementX = ( stage.stageWidth/2) - (extLoader.width/2);
extPicArea.x = extPicPlacementX;
extPicArea.y = extPicPlacementY;
extPicArea.addChild(extLoader);
fadeIn = new Tween(extPicArea, "alpha", None.easeNone, 0, 1, 15, false);
}
}
But as you can see I can't find which variable goes in the URLRequest to make it advance to the next photo. Do I have to make a new variable? All actionscript files are attached. Any help would be appreciated.extxml_load.as
ext.xml
load_thumbnails.as
initial_variables.as
Photo Gallery - Button Help
To whom it may concern....
I have created a horizontal scroll with buttons that moves based on where the mouse is positioned...pretty cool idea. Now, as you highlight each button(small thumbnail)...how can I set it up so when a user clicks on that thumbnail...that a big picture say 300x300 pixels appears above the horizontal scroll menu. I have posted the fla file as well. I am using Flash MX 2004.
Help With Non-working Gallery Button
Hi! I've been working on an image gallery for a while. It loads the images with xml and it's working fine, except I can't get the next-button to work. A variable (offset) decides how many pictures show up at the time (6 atm), but without the button these are the only pictures visible. The next-button picture (external jpg) shows up, but the on.release-part is not working at all; I still get the arrow cursor, not the hand, and nothing happens when I click on it. I put a trace in there to test it, but it doesn't show in the output-box. Any thoughts?
(I'm sorry if this doesn't come out right, I'm new to this forum and I haven't tried posting code here before.)
---------
var myImages = new XML();
var offset:Number = 0;
myImages.ignoreWhite = true;
myImages.onLoad = function(success) {
allImages = this.firstChild.childNodes.length;
spacing = 70;
for (i=offset; i<(offset+6); i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 0);
this.thumbLoader.loadMovie(this.picHolder.attribut es.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.stor = this.picHolder.attributes.stor;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.stor);
title_txt.text = this.title;
};
//next-button
this.nextHolder = nextBtn.createEmptyMovieClip("nextPic", 0);
this.nextHolder.loadMovie("pix/next.jpg");
this.nextHolder.onRelease = function() {
offset == (offset+6);
//trace("Woot");
};
}
};
myImages.load("xml/4bilder.xml");
Simple Button/gallery ?
Hey everybody, I'm not very familiar with the new ActionScript 3.0 and am quite confused since I've never actually done something like the project I'm working on.
Anyways, what I would like to happen is that I have about 25 buttons and a display area. What I would like to happen is that the display area always displays a certain image. Each button has a certain image linked to it so that when you roll-over a button, the displayed image changes to that certain buttons image, and when you roll off the default image is displayed.
How would I go about implementing this using Actionscript 3.0? I know how to do a roll-over event listener but I have no idea on how to go about changing another object. Thanks!
Photo Gallery Next Button
Using a template, I have conquered most of the hurdles, but one of the last ones, is in the photo gallery it came with.... I have found the clip that holds the keyframes (pictures) but I don't know the code for the "next button" to start scrolling the pics. The way it was designed was as you hit the next button, it opens a set of three thumbnails... I would rather it just hit next frame.... any ideas? I do not want a slide show, but rather the user click each time to get to next picture... (I would need the back button script as well please)
the script currently is below
on (rollOver) {
gotoAndPlay("t1");
}
on (releaseOutside, rollOut) {
gotoAndPlay("t2");
}
on (release) {
if (_root.fl == 1) {
_parent["d"+_root.i].gotoAndPlay("t2");
if (_root.i == 3) {
_root.i = 0;
}
_root.i = _root.i+1;
_root.fl = 0;
_parent.pics.play();
_parent["d"+_root.i].gotoAndPlay("t1");
}
}
XML Gallery - Next/previous Button
Hi All,
I have got some code for an XML gallery which has thumbnails and large images. I have tried a few things and done research, but I am not an actionscript wizz and I can't work out how to adapt this code (below). I want to make "next" and "previous" buttons to go from one image to the next. Anyone got any ideas?
PHP Code:
var generalXML:XML = new XML();
generalXML.ignoreWhite = true;
generalXML.load("general.xml");
generalXML.onLoad = loadGeneralXML;
function loadGeneralXML(loaded) {
if (loaded) {
theRootNode = this.firstChild;
theTitle = theRootNode.childNodes[0].childNodes[0].nodeValue;
theCopyright = theRootNode.childNodes[1].childNodes[0].nodeValue;
theEmailText = theRootNode.childNodes[2].childNodes[0].childNodes[0].nodeValue;
theEmailAddress = theRootNode.childNodes[2].childNodes[1].childNodes[0].nodeValue;
mc_topTitle.txtTitle.text = theTitle;
txtCopyright.text = theCopyright;
mc_email.theEmailText = theEmailText;
mc_email.txtEmail.text = theEmailText;
mc_email.theEmailAddress = theEmailAddress;
}
}
// The following is for the thumbnails and big image
var myXML2:XML = new XML();
myXML2.ignoreWhite = true;
myXML2.load("gallery.xml");
var Name:Array = Array();
var description:Array = Array();
var thumbPath:Array = Array();
var picPath:Array = Array();
var linkURL:Array = Array();
var bgcolor:Array = Array();
var imageWidth:Array = Array();
var imageHeight:Array = Array();
_root.currentCatID = 1;
_root.numberPerRow = 5;//7
_root.gapH = 20;//5
// horizontal space
_root.gapV = 5;
// vertical space (between rows)
_root.rowPerPage = 4;//2
// how many rows per page
_root.itemsPerPage = _root.numberPerRow*_root.rowPerPage;
_root.currentPage = 1;
myXML2.onLoad = function(success) {
displayPage();
};
function displayPage() {
//remove existing thumbnails
for (var i = 0; i<_root.numberOfItems; i++) {
removeMovieClip(flash_mc["img"+i]);
}
xml = myXML2.firstChild;
_root.numberOfItems = xml.childNodes.length;
_root.numberInCategory = 0;
var itemsInThisCat:Array = Array();
for (var i = 0; i<_root.numberOfItems; i++) {
if (xml.childNodes[i].childNodes[7].childNodes[0].nodeValue == _root.currentCatID) {
_root.numberInCategory++;
itemsInThisCat.push(i);
}
}
// remove existing pagination
for (var i = 0; i<_root.lastNumberOfPage; i++) {
removeMovieClip(mc_pagination["mc_paging"+i]);
}
var numberOfPages:Number = Math.ceil(_root.numberInCategory/_root.itemsPerPage);
_root.lastNumberOfPage = numberOfPages;
// display page: what/what
mc_pagination.pageof.text = "Page: "+_root.currentPage+"/"+numberOfPages;
mc_pagination.mc_paging._visible = false;
for (var i = 0; i<numberOfPages; i++) {
mc_pagination.mc_paging.duplicateMovieClip("mc_paging"+i, i);
mc_pagination["mc_paging"+i].pageNumber.text = i+1;
// if there is only one page, don't display the pagination buttons
if (numberOfPages == 1) {
mc_pagination["mc_paging"+i]._visible = false;
}
// disable the current page number button and change its color
if (mc_pagination["mc_paging"+i].pageNumber.text == _root.currentPage) {
myColor1 = new Color(this.mc_pagination["mc_paging"+i].mc_pageBg);
myColor1.setRGB(0xFB6C1E);
mc_pagination["mc_paging"+i].enabled = false;
} else {
mc_pagination["mc_paging"+i].enabled = true;
}
mc_pagination["mc_paging"+i]._x = mc_pagination.mc_paging._x-(mc_pagination.mc_paging._width+4)*(numberOfPages-i-1);
}
var firstItemThisPage:Number = _root.itemsPerPage*(_root.currentPage-1);
var LastItemThisPage:Number = firstItemThisPage+_root.itemsPerPage;
LastItemThisPage>itemsInThisCat.length ? LastItemThisPage=itemsInThisCat.length : LastItemThisPage=LastItemThisPage;
j = 0;
firstItemThisCat = undefined;
for (var i = firstItemThisPage; i<LastItemThisPage; i++) {
if (firstItemThisCat == undefined) {
firstItemThisCat = i;
}
Name[i] = xml.childNodes[itemsInThisCat[i]].childNodes[0].childNodes[0].nodeValue;
description[i] = xml.childNodes[itemsInThisCat[i]].childNodes[1].childNodes[0].nodeValue;
thumbPath[i] = xml.childNodes[itemsInThisCat[i]].childNodes[2].childNodes[0].nodeValue;
picPath[i] = xml.childNodes[itemsInThisCat[i]].childNodes[3].childNodes[0].nodeValue;
linkURL[i] = xml.childNodes[itemsInThisCat[i]].childNodes[4].childNodes[0].nodeValue;
imageWidth[i] = xml.childNodes[itemsInThisCat[i]].childNodes[5].childNodes[0].nodeValue;
imageHeight[i] = xml.childNodes[itemsInThisCat[i]].childNodes[6].childNodes[0].nodeValue;
flash_mc.img.duplicateMovieClip("img"+i, i);
//_root["movie"+i]._x = movie0._x+(i*180);
realRow = Math.floor(j/_root.numberPerRow);
row = realRow-((_root.currentPage-1)*_root.rowPerPage);
flash_mc["img"+i]._x = flash_mc.img._x+(j-(realRow*_root.numberPerRow))*(flash_mc.img._width+_root.gapH);
flash_mc["img"+i]._y = flash_mc.img._y+realRow*(flash_mc.img._height+_root.gapV);
flash_mc["img"+i].img_mc.loadMovie(thumbPath[i]);
flash_mc["img"+i].theSiteName = Name[i];
flash_mc["img"+i].theLinkURL = linkURL[i];
flash_mc["img"+i].thePicPath = picPath[i];
flash_mc["img"+i].theSiteDesc = description[i];
flash_mc["img"+i].theWidth = imageWidth[i];
flash_mc["img"+i].theHeight = imageHeight[i];
j++;
if (j>=_root.itemsPerPage) {
break;
}
//load the first big image
getFirst(picPath[firstItemThisCat], linkURL[firstItemThisCat], Name[firstItemThisCat], description[firstItemThisCat], imageWidth[firstItemThisCat], imageHeight[firstItemThisCat]);
}
}
/////////////////// I added the code below, not sure if it's good but it works
function clearIt(thePicPath:String, theLinkURL:String, theSiteName:String, theSiteDesc:String, theWidth:Number, theHeight:Number) {
theBigImageContainer = _root.mc_main.big_mc.big_mc_image;
theHelper = _root.mc_main.mc_helper;
theImageWidth = theWidth;
theImageHeight = theHeight;
theDisplayAreaWidth = Stage.width;
theDisplayAreaHeight = Stage.height-_root.mc_main.mc_topTitle._height-_root.mc_main.mc_thumbArea._height-_root.mc_main.mc_description._height;
theBigImageContainer.unloadMovie(thePicPath);
_root.mc_main.mc_bigImageBg._visible = false;
_root.mc_main.loader._y = 900;
}
back_btn.onRelease = function () {
clearIt();
}
//////////////////// end of my addition:confused:
//for loading first big image
function getFirst(thePicPath:String, theLinkURL:String, theSiteName:String, theSiteDesc:String, theWidth:Number, theHeight:Number) {
theBigImageContainer = _root.mc_main.big_mc.big_mc_image;
theHelper = _root.mc_main.mc_helper;
theImageWidth = theWidth;
theImageHeight = theHeight;
theDisplayAreaWidth = Stage.width;
theDisplayAreaHeight = Stage.height-_root.mc_main.mc_topTitle._height-_root.mc_main.mc_thumbArea._height-_root.mc_main.mc_description._height;
_root.mc_main.loader._x = (theHelper._x+theDisplayAreaWidth/2)-15;
_root.mc_main.loader._y = theHelper._y+theDisplayAreaHeight/2;
theBigImageContainer.loadMovie(thePicPath);
_root.mc_main.big_mc._x = theHelper._x+(theDisplayAreaWidth-theImageWidth)/2;
_root.mc_main.big_mc._y = theHelper._y+(theDisplayAreaHeight-theImageHeight)/2;
_root.mc_main.mc_bigImageBg._x = _root.mc_main.big_mc._x-4;
_root.mc_main.mc_bigImageBg._y = _root.mc_main.big_mc._y-6;
_root.mc_main.mc_bigImageBg._width = theImageWidth*1+8;
_root.mc_main.mc_bigImageBg._height = theImageHeight*1+8;
if (theSiteDesc == undefined) {
_root.mc_main.textbox.siteName.text = theSiteName;
} else {
_root.mc_main.textbox.siteName.text = theSiteName+" - "+theSiteDesc;
}
percentage = 0;
var colorful = new Color("_root.mc_main.mc_bgcolor");
var theColor = "0x"+theBgColor;
colorful.setRGB(theColor);
flash_mc.a_mc.onEnterFrame = function() {
amountLoaded = theBigImageContainer.getBytesLoaded()/theBigImageContainer.getBytesTotal()*100;
percentage += (amountLoaded-percentage)/2;
theBigImageContainer._visible = false;
_root.mc_main.big_mc.loader.gotoAndStop(Math.round(percentage));
if (percentage>99) {
delete flash_mc.a_mc.onEnterFrame;
theBigImageContainer._visible = true;
_root.mc_main.big_mc.loader._visible = false;
_root.mc_main.big_mc.changeColor();
}
};
_root.mc_main.big_mc.onRelease = function() {
getURL(theLinkURL, "_blank");
};
if (theLinkURL == undefined) {
_root.mc_main.big_mc.enabled = false;
} else {
_root.mc_main.big_mc.enabled = true;
}
}
Creating Xml Gallery Button
I need to greate buttons, what takes pictures form xml fail. In scotty xml gallery there are 4 "gallery" buttons what i need, but i dont know how do create them. I give also page too - http://www.2rdesign.com/gallery/V3_thumbs_scrolled.html
so i repeat it shortly, how do great these kind of buttons (gallery 1, gallery 2, gallery 3 and gallery 4)
Xml Gallery Button Question
Hi, I'm using kirupa's gallery and was wondering if there was a way to assign AS to a button (not dynamically created) that will move the gallery to a specific image. Maybe somthing like this?
ActionScript Code:
buttton.onRelease = function() { showImage();};}function showImage(p) { fadeOut(image[p]); p = 3; picture._visible = 1; picture._alpha = 0; desc_txt.text = description[p]; comment_txt.text = comment[p]; caption_txt.text = caption[p]; comment_txt.autoSize = true; picture_num();
Thanks for any suggestions. Here's the code I'm using:
ActionScript Code:
function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; description = []; comment = []; caption = []; total = xmlNode.childNodes.length; for (i=0; i<total; i++) { image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; comment[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue; caption[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue; } id = setInterval(preloadPic, 100); } else { content = "file not loaded!"; }}xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("images.xml");var loadTot = 0;var k = 0;preloader.preload_bar._xscale =0;// ///////////////////////////////////function preloadPic() { clearInterval(id); var con = picture.duplicateMovieClip("con"+k, 9984+k); con.loadMovie(image[k]); var temp = _root.createEmptyMovieClip("temp"+k, 99+k); temp.onEnterFrame = function() { var total = con.getBytesTotal(); var loaded = con.getBytesLoaded(); percent = Math.round((loaded/total*100)/image.length); preloader.preload_bar._xscale = loadTot+percent; info.text = "loading image "+k+" of "+image.length+" "; if (loaded == total && total>4) { con._visible = 0; nextPic(); loadTot += percent; delete this.onEnterFrame; } };}function nextPic() { if (k<image.length-1) { k++; preloadPic(); } else { firstImage(); contents.swapDepths(9999); }}// ///////////////////////////////////var p = 0;var current;MovieClip.prototype.fadeIn = function() { if (this._alpha<100) { current._alpha -= 10; this._alpha += 10; } else { current._visible = 0; delete this.onEnterFrame; }previous_btn.onRelease = function() {prevImage();};next_btn.onRelease = function() { nextImage();}; };function nextImage() { current = this["con"+p]; p++; ///////////////////////////////////// if (p == 0) { preloader._visible = false;} ///////////////////////////////////// ///////////////////////////////////// if (p == 1) { preloader._visible = false;} ///////////////////////////////////// ///////////////////////////////////// if (p == 1) { contents.loadMovie("sub1_new.swf"); } else { contents._visible = false;} ///////////////////////////////////// var picture = this["con"+p]; picture._visible = 1; picture._alpha = 0; picture.onEnterFrame = fadeIn; desc_txt.text = description[p]; comment_txt.text = comment[p]; caption_txt.text = caption[p]; comment_txt.autoSize = true; picture_num();}function prevImage() { current = this["con"+p]; p--; if (p == 1) { contents.loadMovie("sub1_new.swf"); } else { contents._visible = false;} var picture = this["con"+p]; picture._visible = 1; picture._alpha = 0; picture.onEnterFrame = fadeIn; desc_txt.text = description[p]; comment_txt.text = comment[p]; caption_txt.text = caption[p]; comment_txt.autoSize = true; picture_num();}function firstImage() { con0._visible = 1; con0._alpha = 0; con0.onEnterFrame = fadeIn; desc_txt.text = description[0]; comment_txt.text = comment[0]; caption_txt.text = caption[0]; comment_txt.autoSize = true; picture_num();}function picture_num() { current_pos = p+1; pos_txt.text = current_pos+" of "+total; if (p == 0) { previous_btn._alpha = 40; previous_btn.enabled = false; } else { previous_btn._alpha = 100; previous_btn.enabled = true; } if (p == (total-1)) { next_btn._alpha = 40; next_btn.enabled = false; } else { next_btn._alpha = 100; next_btn.enabled = true; }}
[AS] - Button Image Gallery
i have 45 buttons and i want to have each button load an image. all of the 45 buttons are in one MC and i want to load the pix in a mc out of that mc. anyway in the mc with all of the buttons in it, i named each button img01 - img45. I also applied this script on the first and only frame:
ActionScript Code:
if(i=0,i<=45,i++){
_this["img"+i].tag = i;
_this["img"+i].onRelease = function()
{
_parent.picture_mc.loadMovie("imagegallery/img"+tag+".jpg")
}
}
else
{
trace("doesnt work");
}
i want to make each button load the coresponding image but the only thing is that the script doesnt work and i dunno whats wrong. someone else helped me with this script tho.
can anyone please help me out here?
thanks!
austin
|