Dynamic Resizing Image Gallery
Hello everyone,
I've been trying to learn how to dynamically resize a box on stage to fit externally loaded images. I'm sure everyone has seen it done a number of times, but I'm finding surprisingly little resources out there explaining how. I've searched all the forums, unfortunately to no avail. The only thing I've found on Google is this:
http://www.cambodiaxp.com/flash-experiment-movie6.html
Which is very close to what I'm looking to do, except I want to anchor the top left of the box to the corner, so that it only expands/retracts to the right and down. I'd also like to have additional padding to the left for a description of the item. I downloaded the source, and it was written for Flash 6, and without any instructions so I'm having a hard time modifying it for what I need.
Does anyone know of any good tutorials or source files for this type of thing? I'm finding it really hard to find anything relating to dynamic resizing in Flash. Any tips greatly appreciated!!
Thanks,
Luke
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 05-10-2007, 09:06 PM
View Complete Forum Thread with Replies
Sponsored Links:
[F8] Dynamic Resizing Image Gallery
Hello everyone,
I've been trying to learn how to dynamically resize a box on stage to fit externally loaded images. I'm sure everyone has seen it done a number of times, but I'm finding surprisingly little resources out there explaining how. I've searched all the forums, unfortunately to no avail. The only thing I've found on Google is this:
http://www.cambodiaxp.com/flash-experiment-movie6.html
Which is very close to what I'm looking to do, except I want to anchor the top left of the box to the corner, so that it only expands/retracts to the right and down. I'd also like to have additional padding to the left for a description of the item. I downloaded the source, and it was written for Flash 6, and without any instructions so I'm having a hard time modifying it for what I need.
Does anyone know of any good tutorials or source files for this type of thing? I'm finding it really hard to find anything relating to dynamic resizing in Flash. Any tips greatly appreciated!!
Thanks,
Luke
View Replies !
View Related
Image Gallery And Resizing
Hey,
I have been racking my brains trying to figure out how to do this but I can't! The two pictures I have given are different sizes to represent different browser sizes. The 'menu' stays the same size in the same position and the image/ greyblock scales proportionally to the browser keeping the same border sizes around the image.
I have worked with 'liquid flash' and scaling an imahe proportionally to the full stage width/height. - but can't figure this out.
Any help would be appreciated.
Chris.
View Replies !
View Related
Scotty's Image Resizing Gallery Question...
I m trying to use scotty's infinite resizing image gallery for a project of mine and I was wondering if there was any way to make a vertical scroller for the thumbnails on the left of the actual image with two rows of images rather than just one. I'm new to the forum and I see that a lot of people get helped and I was hoping that someone here might be able to help. Thank you.
View Replies !
View Related
Image Resizing Gallery With Fixed Resolution
I would like to use Flash photo gallery, but I can't fix the problem of large images, even I've tested with Scotty's Image Resizing gallery, if the resolution is too larger e.g. 1024x768
the photo will show up out of the boundary. Do anyone know how to restrict the resolution of each loaded images to specific resolution? This is very useful if the photos need not resize before put into flash photo gallery. Please help!
leungwai
leungwai@pacific.net.hk
View Replies !
View Related
Photo Gallery Using XML And Flash...HELP Resizing Image
I would love to use the photogallery from the above mentioned tutorial
, but just wish that the mc had a resizing scipt. Does anyone know how i can add this into the existing FLA i built from the tutorial. trying to build a photography site for my Digital photography class. post weekly images and progress shots, etc....
Any direction would be nice.
View Replies !
View Related
Resizing/fading Dynamic Gallery Issues...
Hey there. I'm kind of in a huge deadline crunch.
I have a gallery that I built from a tutorial I found online--it has an empty mc with a border around it, and when you click on a thumbnail an image is loaded into the mc and it fades in when it loads in and out.
Ofcourse it works fine offline, but when I test it online the image will load in off-center, if you click the thumbnail again (after it has loaded the first time) it loads in the position it should be in.
Here is the code I have on the first frame:
spacing = 1;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
containerMC._alpha = 0;
this.loadMovie(pic);
onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha += 5;
if (containerMC._alpha>90) {
containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
and here is the code that I have on my btns:
on(release){
_parent.containerMC.loadPic("pic_001.jpg");
}
Any suggestions???
I really need some quick help on this one.
Thanks so much in advanced!!!
hutch.
View Replies !
View Related
Resizing/fading Dynamic Gallery Issues...
Hey there. I'm kind of in a huge deadline crunch.
I have a gallery that I built from a tutorial I found online--it has an empty mc with a border around it, and when you click on a thumbnail an image is loaded into the mc and it fades in when it loads in and out.
Ofcourse it works fine offline, but when I test it online the image will load in off-center, if you click the thumbnail again (after it has loaded the first time) it loads in the position it should be in.
Here is the code I have on the first frame:
spacing = 1;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
containerMC._alpha = 0;
this.loadMovie(pic);
onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha += 5;
if (containerMC._alpha>90) {
containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
and here is the code that I have on my btns:
on(release){
_parent.containerMC.loadPic("pic_001.jpg");
}
Any suggestions???
I really need some quick help on this one.
Thanks so much in advanced!!!
hutch.
View Replies !
View Related
Resizing/fading Dynamic Gallery Issues...
Hey there. I'm kind of in a huge deadline crunch.
I have a gallery that I built from a tutorial I found online--it has an empty mc with a border around it, and when you click on a thumbnail an image is loaded into the mc and it fades in when it loads in and out.
Ofcourse it works fine offline, but when I test it online the image will load in off-center, if you click the thumbnail again (after it has loaded the first time) it loads in the position it should be in.
Here is the code I have on the first frame:
spacing = 1;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
containerMC._alpha = 0;
this.loadMovie(pic);
onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha += 5;
if (containerMC._alpha>90) {
containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
and here is the code that I have on my btns:
on(release){
_parent.containerMC.loadPic("pic_001.jpg");
}
Any suggestions???
I really need some quick help on this one.
Thanks so much in advanced!!!
hutch.
View Replies !
View Related
Resizing/fading Dynamic Gallery Issues...
Hey there. I'm kind of in a huge deadline crunch.
I have a gallery that I built from a tutorial I found online--it has an empty mc with a border around it, and when you click on a thumbnail an image is loaded into the mc and it fades in when it loads in and out.
Ofcourse it works fine offline, but when I test it online the image will load in off-center, if you click the thumbnail again (after it has loaded the first time) it loads in the position it should be in.
Here is the code I have on the first frame:
spacing = 1;
containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic){
containerMC._alpha = 0;
this.loadMovie(pic);
onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha += 5;
if (containerMC._alpha>90) {
containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
and here is the code that I have on my btns:
on(release){
_parent.containerMC.loadPic("pic_001.jpg");
}
Any suggestions???
I really need some quick help on this one.
Thanks so much in advanced!!!
hutch.
View Replies !
View Related
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....
View Replies !
View Related
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....
View Replies !
View Related
HELP....dynamic Image Resizing...
I have some images (jpgs), the images vary in size. The images are supporting graphics
for different stories. I'm loading the images dynamically with the following:
storyPicFunction = function () {
trace("[[ storyPicFunction called ]]");
if(_global.SecondFrame == true ){
loadMovie(_global.level+this.movName+".swf", mcHold2.mcHolder)
}else if(_global.SecondFrame != true){
loadMovie(_global.level+this.movName+".swf", mcHold.mcHolder);
}
};
on the first frame I need them to be full size and on the second frame I need them to
be scaled, due to limited space. and here is the code I'm using to resize
picResize = function(){
trace("picResizeFn: "+_target);
if(_global.SecondFrame == true){
if(this._width > 400){
this._width=this._width/3;
this._height=this._height/3;
}else if(this._width < 400){
this._width=this._width/1.5;
this._height=this._height/1.5;
}
if the images is greater than 400 I divide the width and height by 3 and if it is less than 400 I divide the width and height by 1.5
This works for some of the images and for others it makes them too small. Can anyone offer a solution that will resize my images proportionately so that with width is no less then
195.
Thank you,
View Replies !
View Related
Dynamic Image Resizing
Hi. I just have a question about dynamic runtime image resizing - it's primarily used, or I would use it, for full browser image (fullscreen). And I have done this, that's not the problem. I'm just curious as to quality control and smoothing.. Take a look at this site: http://filippasmedhagensund.com/ when you stop on an image, it is smoothed and looks perfect quality no matter what you resize the window too. BrookPifer.com also had it like that but for some reason the site doesn't work now. Does anyone know how the quality remains so good? When I do it - when the image is at original size, it looks perfect quality, but when I size the window down and thus the image resizes down, the image looks jittery, for example, curves in the image and sometimes jittery as if the anti-alias has just failed or something.. Anyone know what they did and I didn't do? And I'm also curious as to why it looks like the example website I mentioned looks like it has some smoothing (light blurring) when you stop on an image - so if anyone knows why that is, please share. Would be much appreciated. Thanks,
Christian
View Replies !
View Related
Dynamic Image Resizing
Hi
I was working on your flash xml photo album. everything is cool. but I still need help. My images are 640x480 in size. As I load these jpg images in to 'Picture' MC, I want to resize the image to FIT into specific or MC's size [height and width]. I have been trying. but i could not get it. Can someone help me please?
Thanks
krs
View Replies !
View Related
Dynamic Image Loading And Resizing?
Ok I have played around a bit and manage to load jpg images via a text box and a button onto a movie clip. But I can’t get the movie clip to resize at all to fit the image. But after more playing around I think the problem is the size of the document dimensions.
So my two questions are.
[list=1][*]How can I load image so that I don’t have to click on a button. So I can change the html code and have the image load from that url?[*]How would I resize the whole movie clip to fit that image?[/list=1]
Any help would be greatly appreciated.
Thanks
Push
View Replies !
View Related
Dynamic Image Resizing Prob.
Hey,
I'm trying to make an image gallery that loads 3 photos at a time (look at .SWF). I have also built a function that resizes the photos to fit into its respective box once they're loaded (a maximum of 120x120 pixels). The images aren't getting resized, and they aren't getting re-loaded after the "forward" button is pressed the second (,third,fourth,etc...) time. Someone please take a look at the code and see if you can help.
Thanks,
logikal2
View Replies !
View Related
MX04 -Help, Dynamic Image Loading And RESIZING.
Hello all,
http://kirupa.com/developer/mx2004/xml_flash_photogallery.htm
i found this tutorial very helpful. however im looking for some help.
i want to create a flash site that dynamically places images into a flash template. (which the above tutorial teaches) however i want my images to resize based on the res of the user, so that an image could appear near full screen at 800x600 or 1600x1200.
i figured id just put the swf inside some html tables with 100% values.
and that works.. with smaller images being blown up it resizes just fine, however when it does it pixelates of course.. what i need is the ability to load in larger sized images that can display fine at 1600 x 1200 and also shrink down if the rez is smaller. as of now when I load in a larger size it just overshoots the canvas at fullsize.
this is very frustrating, and ive been fighting with this for a long time.
please, if anyone could help me out id be very appreciative.
I got the idea from this site here.. so i know it can be done!
http://www.manipulator.com (and no. the scripting is server site so you cant just decompile it
please please.. help!
thanks
james
jameskachan@hotmail.com
View Replies !
View Related
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
View Replies !
View Related
XML - Resizing Dynamic Image Whilst Maintaining Proportions
Hi,
I have an issue with dynamically loading a picture into Flash from an XML file. What I want to happen is for the image (defined in my xml) to load into a text box or mc with a max height of say 100 px whilst maintaining its proportions. I have looked through other threads and found related topics but can't really make sense of them.
Any help would be gratefully received!
Cheers,
Ben
View Replies !
View Related
Dynamic Image Gallery
Hello. I'm trying to make an image gallery or scroller that is dynamic and easy to update. This is what I mean: I need to find a way to allow flash to access a group of pictures on an online folder and convert them to a flash slideshow or image scroller. Otherwise, I will have to put the images in myself whcih takes way to long. I just got dreamweaver and I'm inspired by how well it automates web site updates. I'm trying to do the same thing with flash. You can reply, e-mail, or instant message me. Your help would be greatly appreciated.
View Replies !
View Related
Dynamic Image Gallery
Hi!
Hope somebody out there can help me. I'm from Germany, so my english is not the best.
Heres my problem:
I'm trying to create an gallery with six oder seven images.
It shoul look like an black and white collage. If u point the mouse over one of the images it should turn incolor and resize it self a lot bigger ( five times or so... ). the other ones should get transparent ( alpha = 0 ).
So here is my point: My action script knownledege is quit basic. I know how to script this and that but thats all.
How the hell do I start??? Tweening alone does not work ;(
thankx Daniel
View Replies !
View Related
Dynamic XML Image Gallery
Hi,
I'm having a problem with my image gallery that you can see at www.xl70e3.com. For some reason preloader is not showing up for any of the images.
This is the script:
Code:
import mx.transitions.*;
_global.thisX = 37;
_global.thisY = 150;
_global.stageWidth = 700;
_global.stageHeight = 310;
var gallery_xml:XML = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success:Boolean) {
try {if (success) {
var images:Array = this.firstChild.childNodes;
var gallery_array:Array = new Array();
for (var i = 0; i<images.length; i++) {
gallery_array.push({src:images[i].firstChild.nodeValue});
}
displayGallery(gallery_array);
} else {
throw new Error("Unable to parse XML");
}
} catch (e_err:Error) {
trace(e_err.message);
} finally {
delete this;
}
};
gallery_xml.load("http://www.blablabla.com/123.xml");
function displayGallery(gallery_array:Array) {
var galleryLength:Number = gallery_array.length;
for (var i = 0; i<galleryLength; i++) {
var thisMC:MovieClip = this.createEmptyMovieClip("image"+i+"_mc", i);
mcLoader_mcl.loadClip(gallery_array[i].src, thisMC);
preloaderMC = this.attachMovie("preloader_mc", "preloader"+i+"_mc", 5000+i);
preloaderMC.bar_mc._xscale = 0;
preloaderMC.progress_txt.text = "0%";
thisMC._x = _global.thisX;
thisMC._y = _global.thisY;
preloaderMC._x = _global.thisX;
preloaderMC._y = _global.thisY+20;
// if you've displayed 5 columns of images, start a new row.
if ((i+1)%7 == 0) {
// reset the X and Y positions
_global.thisX = 37;
_global.thisY += 80;
} else {
_global.thisX += 80;
}
}
}
var mcLoader_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadStart = function() {
};
mclListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
var pctLoaded:Number = Math.round(loadedBytes/totalBytes*100);
var preloaderMC = target_mc._parent["preloader"+target_mc.getDepth()+"_mc"];
preloaderMC.bar_mc._xscale = pctLoaded;
preloaderMC.progress_txt.text = pctLoaded+"%";
};
mclListener.onLoadInit = function(evt:MovieClip) {
evt._parent["preloader"+evt.getDepth()+"_mc"].removeMovieClip();
var thisWidth:Number = evt._width;
var thisHeight:Number = evt._height;
var borderWidth:Number = 4;
var marginWidth:Number = 4;
evt.scale = 20;
evt.lineStyle(borderWidth, 0x000000, 100);
evt.beginFill(0xFFFFFF, 100);
evt.moveTo(-borderWidth-marginWidth, -borderWidth-marginWidth);
evt.lineTo(thisWidth+borderWidth+marginWidth, -borderWidth-marginWidth);
evt.lineTo(thisWidth+borderWidth+marginWidth, thisHeight+borderWidth+marginWidth);
evt.lineTo(-borderWidth-marginWidth, thisHeight+borderWidth+marginWidth);
evt.lineTo(-borderWidth-marginWidth, -borderWidth-marginWidth);
evt.endFill();
evt._xscale = evt.scale;
evt._yscale = evt.scale;
evt.onPress = function() {
this.startDrag();
this._xscale = 100;
this._yscale = 100;
this.origX = this._x;
this.origY = this._y;
this.origDepth = this.getDepth();
this.swapDepths(this._parent.getNextHighestDepth());
this._x = 183;
this._y = 150;
mx.transitions.TransitionManager.start(this, {type:mx.transitions.Photo, direction:0, duration:1, easing:mx.transitions.easing.Strong.easeOut, param1:empty, param2:empty});
};
evt.onRelease = function() {
this.stopDrag();
this._xscale = this.scale;
this._yscale = this.scale;
this._x = this.origX;
this._y = this.origY;
};
evt.onReleaseOutside = evt.onRelease;
};
mcLoader_mcl.addListener(mclListener);
There's gotta be something wrong in there that I just can't figure out...
And another question, while we're at it.
Is it possible to scale the pics down to some set size with automated cropping if required? So that both landscape and portrait-oriented pics would show up as say a 100x100 square? Not just by setting evt._height/width, because that screws up proportions. Maybe use part of the image and scale that down for the thumbnail? Kinda like at www.jkreps.com (check any of the photographers)... or are they creating buttons manually?
Thanks in advance
View Replies !
View Related
Dynamic Image Gallery
Hello,
I would lke to build or buy a Flash image gallery that does the following (or get the desired results):
- Using a select box or other widget, a directory name is selected
- the directory is read for image names and dumped into an array
- then as the forward or backward buttons are clicked, the image names are loaded into a variable and used as the image name parameter.
- it would also have the ability to run as a slideshow.
I am kind of new to Flash, but have some experience. I've had the above done in PHP for a long time now, but I'd really like it to work this way in flash.
If I just need some tips, perhaps there is a tutorial site you could recommend, if there is a gallery like this already built, I'd like to check it out.
I've seen a few nice ones out there, but none that do exactly what I want.
Thanks,
- dstefani
View Replies !
View Related
Help With Dynamic Image Gallery
Hi there.. I have an image gallery with two sets of code. you can see it here. If you care to take a look, you will see that the next buttons load the images successfully, and that the selector at the top fails to do so..
This code loads the scrolling images in the selection area at the top from an xml file..
Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 90;
for (i=0; i<numimages; 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_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() {
photo_mc._alpha = 0;
photo_mc.loadMovie(this.photo);
//photo_mc.loadMovie(this.main);
content.text = description[0];
//photo_mc.loadMovie(this.main);
//loader.loadMovie(this.main);
//title_txt.text = this.title;{
//function firstImage() {
//photo_mc.loadMovie(this.main);
//}
//}
};
}
};
myPhoto.load("images/listings/01/album_gal.xml");
this code loads the images into the movieclip (photo_mc) with the next/back button and resizes the border to fit the image
Code:
space = 10;
photo_mc._alpha = 0;
MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up
// to smaller number.
var total = Math.round(photo_mc.getBytesTotal()/1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
photo_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};
btn1.onRelease = function() {
prevImage();
};
btn2.onRelease = function() {
nextImage();
};
These were taken from two diffrent tutorials and altered to fit my needs, but i am not 1337 enough of an actionscript coder to figure out how to incorporate these two scripts together.
Can somebody please help me with this??? Thank you in advanced =]
View Replies !
View Related
Dynamic Image Gallery
Hello,
I want to develop an image gallery that is driven via thumbnails.
Now I have the thumbnails on the stage. I want to be able to click a thumbnail and it loads the jpeg onto the stage, but I want it to fade up, and then fade away when I click on another thumbnail. Can I do this using duplicateMovieClip?
What is the easiest way?
Many thanks in advance.
View Replies !
View Related
Dynamic Image Gallery
Hi,
My name is Rajesh Kumar.
I m doing an image gallery in flash.
I hav got a file wer everything is there but i want to add some feature like multiline breaf image info.
File is attached here.
This image gallery is drag n drop.
i wanna wen u drag any image in the particular area wer image blowup beside the blow up image i wanna image information also.
i hav kept a textbox beside the image name info.
image info should change for every image drag n drop.
thanks
rajesh kumar
View Replies !
View Related
Dynamic Image Gallery.... I Did It
This is my first post, but I've been here quite a bit trying to figure out how to get actionscript to read the contents of a number of directories, gather all the images in thoes directories and then display them as galleries (with each gallery title equal to the name of the directory containing said picutes).
I coundn't find any examples that did this, but with the help of information I gathered from this site I was able to develop the code. I just wanted to share in case anyone else out there is trying to do the same:
Code:
//this script was designed to dynamically create multiple image galleries
//on the fly based on the structure and content of your web server
//
//it starts at a specified location on your server and parses all directories
//and files below that location and puts the results in an array that can be used to
//preload and display the images
//
//
//the following variables must be defined before calling this script:
//
//rootDir ... = "http://www.mywebsite.com/"//must end in "/"
//rootImageDir... = "images/gallery/"; //must end in "/"
//url... = rootDir+"lister.php?path="+rootImageDir;//see below for info on lister.php
//dirArr1... = new Array();//array to hold directory names
//imageArr ... = new Array();//array to hold image names
//dirArr2... = new Array();//nested array to hold all directories and images paths
//p... = 0;//variable to track each directory
//
//a lister.php file (displayed at the end of this script) must exist on the web server
//it's currently coded to only return .jpg files, but can be easily modifed to gather the filetype(s) of your choice
//
//the directory structure on the web server should match the
//following (or this script be changed to reflect your setup):
//
//.
//www
//images
//gallery
//directory1
//image1.jpg
//image2.jpg...
//directory2...
//create an XML listing of all the directories under rootImageDir_______________________________________
//
function listLayer1() {
varXML1 = new XML();//create new XML object for directory results
varXML1.ignoreWhite = true;//ignore white space in XML object
varXML1.load(url);//load data from php script into XML object
varXML1.onLoad = getDirList;//when XML object is fully loaded goto getDirList function
}
//create an XML listing of the contents of directories gathered in previous function____________________
//
function listLayer2() {
varXML2 = new XML();//create new XML object for image results
varXML2.ignoreWhite = true;//ignore white space in XML object
varXML2.load(url+dirArr1[p]);//load data from php script into XML object for specific directories
varXML2.onLoad = getImageList;//when XML object is fully loaded goto getImageList function
}
//parse the XML object that contains a listing of our directories (varXML1)_____________________________
//and populate the directory array (dirArr1)
//
//called by listLayer1()
//
function getDirList() {
for(i=0; i < varXML1.firstChild.childNodes.length; i++){//for each entry in varXML1 check...
if(varXML1.firstChild.childNodes[i].nodeName=="dir"){//if enty is a directory, and if it is...
dirArr1.push(varXML1.firstChild.childNodes[i].firstChild.nodeValue);//put it in the directory array
}
}
varXML1 = "";//cleanup
listLayer2(); //go after the contents once the directory array if populated
}
//parse the XML object that contains a listing of the contents of our directories (varXML2)_____________
//and poplulate the image array (dirArr2)
//
//called by listLayer2()
//
function getImageList() {
for(m=0; m < varXML2.firstChild.childNodes.length; m++){//loop through the results for each directory
if(varXML2.firstChild.childNodes[m].nodeName=="file"){//if entry is a file...
imagePath = rootDir + rootImageDir + dirArr1[p] + "/" + varXML2.firstChild.childNodes[m].firstChild.nodeValue;
imageArr.push(imagePath);//put it's full path in the files array
}
}
dirArr2[p] = new Array(dirArr1[p]);//create nested arrary with #.0 = gallery name
for(w=0; w < imageArr.length; w++){//for each image...
dirArr2[p].push(imageArr[w]);//populate nested array w/ image paths
}
p++//increment p (used in listLayer2)
if(p <= dirArr1.length -1){//if thre are more directories to parse...
listLayer2(); //request another file listing
}
else {call some funtion that processes the images();}//call a funtion that does something with the array (pre-load & display images)
imageArr = new Array();//clear imageArr for next cycle
}
//The following PHP script is to be placed in the root www folder on the web server:
//<?
////$path is sent from actionscript
//// Open the folder
//$dir_handle = @opendir($path) or die("Unable to open $path");
//echo "<?xml version='1.0' encoding='ISO-8859-1'?>";
//echo "<filelist>";
//// Loop through the files
//while ($file = (readdir($dir_handle))) {
// if($file == "." || $file == ".." || $file == "lister.php" )
//continue;
//$exploded = explode(".",$file);
//if((strtolower($exploded[1])) == "jpg"){
//echo "<file>$file</file>";
// }
//else {
//if(is_dir($path.$file)){
//echo "<dir>$file</dir>";
//}
//}
//}
//echo "</filelist>";
//// Close
//closedir($dir_handle);
//?>
Thanks for all the help! If anyone knows of a way to improve this, or is aware of another way to acheive the same results, please let me know (jd2000@gmail.com), but this code is working great for me so far.
-James
View Replies !
View Related
Dynamic Image Gallery V2
hello again all,
I am trying to put together a 'simple' gallery. I have used the script that CyanBlue provided in this post:
http://www.actionscript.org/forums/s...d.php3?t=40439
and adapted it slightly.
What I am trying to do is display an icon with an alpha of 33% to show how many images there are, preload the images in the background, and as each one loads, make the icon alpha 100% and make it an active button that can be clicked to display the image.
see that attached file. Any suggestions on the best way to do this would be great.
thanks.
View Replies !
View Related
Dynamic Image Gallery
Hi,
I'm having a problem here with the dynamic gallery that loads data from XML. It's basically the same code as in the gallery_tween sample from Flash 8 with a few bits changed.
Here's the code:
Code:
stop();
import mx.transitions.*;
_global.thisX = 57;
_global.thisY = 150;
_global.stageWidth = 700;
_global.stageHeight = 310;
var gallery_xml:XML = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success:Boolean) {
try {if (success) {
var images:Array = this.firstChild.childNodes;
var gallery_array:Array = new Array();
for (var i = 0; i<images.length; i++) {
gallery_array.push({src:images[i].firstChild.nodeValue});
}
displayGallery(gallery_array);
} else {
throw new Error("Unable to parse XML");
}
} catch (e_err:Error) {
trace(e_err.message);
} finally {
delete this;
}
};
gallery_xml.load("http://www.blablabla.com/123.xml");
function displayGallery(gallery_array:Array) {
var galleryLength:Number = gallery_array.length;
for (var i = 0; i<galleryLength; i++) {
var thisMC:MovieClip = this.createEmptyMovieClip("image"+i+"_mc", i);
mcLoader_mcl.loadClip(gallery_array[i].src, thisMC);
preloaderMC = this.attachMovie("preloader_mc", "preloader"+i+"_mc", 5000+i);
preloaderMC.bar_mc._xscale = 0;
preloaderMC.progress_txt.text = "0%";
thisMC._x = _global.thisX;
thisMC._y = _global.thisY;
preloaderMC._x = _global.thisX;
preloaderMC._y = _global.thisY+20;
// if you've displayed 5 columns of images, start a new row.
if ((i+1)%7 == 0) {
// reset the X and Y positions
_global.thisX = 57;
_global.thisY += 80;
} else {
_global.thisX += 80+20;
}
}
}
var mcLoader_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
mclListener.onLoadStart = function() {
};
mclListener.onLoadProgress = function(target_mc, loadedBytes, totalBytes) {
var pctLoaded:Number = Math.round(loadedBytes/totalBytes*100);
var preloaderMC = target_mc._parent["preloader"+target_mc.getDepth()+"_mc"];
preloaderMC.bar_mc._xscale = pctLoaded;
preloaderMC.progress_txt.text = pctLoaded+"%";
};
mclListener.onLoadInit = function(evt:MovieClip) {
evt._parent["preloader"+evt.getDepth()+"_mc"].removeMovieClip();
var thisWidth:Number = evt._width;
var thisHeight:Number = evt._height;
var borderWidth:Number = 4;
var marginWidth:Number = 4;
evt.scale = 20;
evt.lineStyle(borderWidth, 0x000000, 100);
evt.beginFill(0xFFFFFF, 100);
evt.moveTo(-borderWidth-marginWidth, -borderWidth-marginWidth);
evt.lineTo(thisWidth+borderWidth+marginWidth, -borderWidth-marginWidth);
evt.lineTo(thisWidth+borderWidth+marginWidth, thisHeight+borderWidth+marginWidth);
evt.lineTo(-borderWidth-marginWidth, thisHeight+borderWidth+marginWidth);
evt.lineTo(-borderWidth-marginWidth, -borderWidth-marginWidth);
evt.endFill();
evt._xscale = evt.scale;
evt._yscale = evt.scale;
evt.onPress = function() {
this.startDrag();
this._xscale = 100;
this._yscale = 100;
this.origX = this._x;
this.origY = this._y;
this.origDepth = this.getDepth();
this.swapDepths(this._parent.getNextHighestDepth());
this._x = 183;
this._y = 150;
mx.transitions.TransitionManager.start(this, {type:mx.transitions.Photo, direction:0, duration:1, easing:mx.transitions.easing.Strong.easeOut, param1:empty, param2:empty});
};
evt.onRelease = function() {
this.stopDrag();
this._xscale = this.scale;
this._yscale = this.scale;
this._x = this.origX;
this._y = this.origY;
};
evt.onReleaseOutside = evt.onRelease;
};
mcLoader_mcl.addListener(mclListener);
Now, how would I go about unloading the gallery? I have it placed on one frame, but when I want to go to some other one, the gallery is still loaded and placed above the rest of the movie. How to completely clear the frame again with a click of a button?
Thanks in advance.
View Replies !
View Related
Dynamic Image Gallery
Is there a tutorial anyone knows of where I can create an image gallery that when you click on a button the image is loaded in and shows up (even a preloader to show the image loading)? I want to do this instead of have each picture in my movie because of file size.
Thanks!
View Replies !
View Related
Dynamic Image Gallery AS2
I have dipped in almost every search engine and this site to locate some easier way to create dynamic image gallery in Flash 8 AS2 using ASP (as i am conversant with ASP only, although i found many sites suggesting PHP and XML). I'd be very greatful to u all if u could provide me some help in this part of my project.
I have tried this source also but neither the source throw any error nor it displays the images, what could be wrong with the source? Please Please Please Please Please Help me!!!!!!!!
this.createClassObject(mx.containers.ScrollPane, "scroller_sp", 10);
scroller_sp. setSize (100, 300);
swfThumbs=["imgs/img1.jpg","imgs/img2.jpg","imgs/img3.jpg"]
this.createEmptyMovieClip("clipLoader",1);
for(i=0;i< swfThumbs.length;i++){
clipLoader.createEmptyMovieClip("clip"+i+"_mc",i)
clipLoader.attachMovie("clip"+i+"_mc","clip"+i+"_mc",i+10);
clipLoader.loadMovieNum(swfThumbs,i+100);
}
scroller_sp.contentPath = clipLoader;
thanks in anticipation and regards
raajaindra
Edited: 09/13/2007 at 12:26:10 AM by indianraaj
View Replies !
View Related
Dynamic Image Gallery
Hi all, I am new to the forum and I have a specific question about a dynamic image gallery i am making.
Everything goes well, until I want to click from a thuimbnail to see an enlarged image that is another file.
here is the specific code for that:
1) one problem is that -when I wlick one of the 5 jpegs attached- I always see the last one enlarged...
2) another problem is to go back to the thumbs after clicking the enlarged image...
PLease help me
Attach Code
//adding the thumbnails
//loading the vars
var loader:MovieClipLoader = new MovieClipLoader(); //loads the movieclip
var loader2:MovieClipLoader = new MovieClipLoader(); //loads the movieclip
var thumbPlace:MovieClip = thumbs_mc //the main movieclip on stage
var mc:MovieClip //the thumb movieclip under iteration
var lmc:MovieClip //the enlarged movieclip when RollOver/click
var mcInstance:String //the variable instance name of the thumb movieclip
//localizing the thumbplace and lmc empty movieclips
thumbPlace._x = 0
thumbPlace._y = 0
//let's make lmc
LargeMovie = _root.createEmptyMovieClip("LargeMovie", _root.getNextHighestDepth());
LargeMovie._x = 0 ;
LargeMovie._y = 0;
lmc = LargeMovie.createEmptyMovieClip("bigImage", _root.getNextHighestDepth());
lmc._x = 0
lmc._y = 0
//making the iteration
for (var i:Number=1; i<6; i++){
//making the thumbs
mcInstance = "thumb" + i //instance of the iterated movieclips
mc = thumbPlace.createEmptyMovieClip (mcInstance, thumbPlace.getNextHighestDepth()); //mc is being linked to the iteration, copying the thumbs
mc._x = i*90
mc._y = 300
var thumbPath = "Rozenhof/thumbs/" + i + ".jpg";
var bigImagePath = "Rozenhof/" + i + ".jpg";
loader.loadClip (thumbPath, mc)//loading the jpegs into the mc movieclip
var loaderListener:Object = new Object(); //making a loadlistener variable
loader.addListener (loaderListener); //make an addlistenser to the loaded movieclips
loaderListener.onLoadInit = function (target: MovieClip){
trace (target);
target.onPress = function (){
LargeMovie.enabled = true
LargeMovie._alpha = 100;
thumbPlace._alpha = 0;
loader2.loadClip (bigImagePath, lmc)
var loaderListener2:Object = new Object();
loader2.addListener (loaderListener2);
loaderListener2.onLoadInit = function (target2: MovieClip){
trace (target2)
target2.onPress = function (){
LargeMovie.enabled = false;
LargeMovie._alpha = 0;
thumbPlace._alpha = 100;
gotoAndPlay (target.onPress);
}
}
}
}
}
View Replies !
View Related
Dynamic Image Gallery
hello folks!
i need to create a dynamic image gallery. the files are defined in an array like imgs = ['img1.jpg','img2.jpg']; then i loop through the array. the images should be arranged horizontally..
how i do this?
thanks for any answer!
oliver
Code:
this.imgs = ['test.jpg','bla.jpg'];
var x = 0;
var y = 0;
var i;
for (i in imgs) {
var t = this.createEmptyMovieClip ("thumbnail" + i, i);
var c = t.createEmptyMovieClip ("picHolder", 0);
var thumb = imgs[i];
c.loadMovie (thumb);
c._x = x + i * c._width;
c._y = y;
}
View Replies !
View Related
Dynamic Image Gallery
We have loaded a series of dynamic images from a database into a thumbnail movie clips. Once clicked the thumbnail will open its image in larger dimensions.
Is there anyway to use the existing image data already preloaded in the thumbnail. At the moment it is loading twice.
Essentially is there anyway of getting the contents of one movie clip and putting it into another?
Many thanks!
J
View Replies !
View Related
Dynamic Image Gallery
Hey
I know that these issues have probably been discussed before, but I'll try anyway, since I have some minor problems.
1.I have been able to fill an array in flash with images that lies in a certain folder on my server, with the use of PHP, and this is the code:
PHP Code:
<?php$dir = opendir("images/");while ($file = readdir($dir)) {if ($file=="." or $file=="..") continue;$string.= $file;$string.= ", ";}echo "imgList=".$string;?>
I will catch the array in flash with this AS-code:
Code:
lv = new LoadVars();
lv.load("imagearray.php");
lv.onLoad = function(success) {
if (success) {
pArray = this.imgList.split(", ");
}
else {
trace("could not load file");
}
}
It works fine, except for one thing, when I first visit my site, the array is empty, it takes some surfing time on the site before the arrays start to work.
I have found out that I get this message when I trace the path:
Quote:
Error opening URL "http://www.mysite.com/mysite/image.jpg"
Do u think it's due to the server itself or the PHP ?
2.I get the images through the array on my site, now I wonder how I can create a dynamic image thumbnail scroller, the kind that moves the list with thumbnails to the left when the cursor enters the right side of the thumbnail row. This have been discussed before, but it always seem to require an xml-file, which I don't use (to be honest, because I can't see the benefit of it )
The problem is that all the thumbnails has to be dynamicly loaded into the "slideshow", i.e. read from the array and placed with a correct size, 40x40...
I would really appreciate some help here, have been working on my site for ages now, want to publish it soon!
Thanx dudes...
/henrik, sweden
ps.can Scotty step in and save the day for a person in need once again?.ds.
View Replies !
View Related
Dynamic Image Gallery With XML
OK. I know that there are tutorials on image galleries (both using an array and XML), and I have read tons of threads, including Scotty's great sticky one that summarizes all of the XML options. The one I am most interested in is the one that creates a PHP that automatically creates an array that is loaded into the flash file - this way I can just upload new images into a new folder and update the site very easily.
I can get this to work fine, however my server doesn't support PHP (I know that is a whole other issue in itself but bear with me).
That being siad, is there a way to do the same thing with XML - that is get it to automatically list the image names instead of needing to type in the names in a new file with every update?
Thanks for the help.
View Replies !
View Related
Dynamic Image Gallery / PHP Help
Background: I'm building a dynamic image gallery for a friend to showcase her design work. She is a fashion designer, and therefor her work is broken up into seasons.
Using the code from this thread, I have gotten a combination of AS and PHP to dynamically load whatever images are in a directory into the swf. That's step 1.
The catch is she needs to archive her stuff each new season, yet have it be accessible.
My PHP knowledge is essentially non-existent, so I turn to you, my invaluable Kirupa forum resource, to help me out.
What I was thinking of doing is simply having her create sub-directories for each archived season within the /archive directory; and from there, having a PHP file read each sub-directory name (or possibly a file within each directory) and then pass that on to AS where I can dynamically create buttons for each one (such as "Fall '06", "Winter2005" or something along those lines).
ALSO: the code I'm using has one slight hitch I need to try and resolve: when you reach the end of the gallery, it gets a little jenky. Is there any way for the PHP file to tell flash what the file count is, or perhaps start the gallery over?
Thank you oh so very much in advance.
View Replies !
View Related
Dynamic Image Gallery
hi guys i am lookin for similar to this image gallery
http://weedonphoto.com/gallery.php?i...04ecc5a7ed2276
dose any body knows how to get this kind of dynamic image gallery
or dose any body knows this kind of tutorial's link
View Replies !
View Related
Dynamic Image Gallery
Hello Friends,
I need your help because I have little knowledge about action script. I want to make a dynamic loaded flash gallery, which scroll horizontally through mouse position. You can here What I want to make.
http://anayaphoto.com
Please help me.
your friend
himanshu
View Replies !
View Related
Dynamic Image Gallery
hello folks!
i need to create a dynamic image gallery. the files are defined in an array like imgs = ['img1.jpg','img2.jpg']; then i loop through the array. the images should be arranged horizontally..
how i do this?
thanks for any answer!
oliver
Code:
this.imgs = ['test.jpg','bla.jpg'];
var x = 0;
var y = 0;
var i;
for (i in imgs) {
var t = this.createEmptyMovieClip ("thumbnail" + i, i);
var c = t.createEmptyMovieClip ("picHolder", 0);
var thumb = imgs[i];
c.loadMovie (thumb);
c._x = x + i * c._width;
c._y = y;
}
View Replies !
View Related
Dynamic Image Gallery
We have loaded a series of dynamic images from a database into a thumbnail movie clips. Once clicked the thumbnail will open its image in larger dimensions.
Is there anyway to use the existing image data already preloaded in the thumbnail. At the moment it is loading twice.
Essentially is there anyway of getting the contents of one movie clip and putting it into another?
Many thanks!
J
View Replies !
View Related
Dynamic Image Gallery
Hey
I know that these issues have probably been discussed before, but I'll try anyway, since I have some minor problems.
1.I have been able to fill an array in flash with images that lies in a certain folder on my server, with the use of PHP, and this is the code:
PHP Code:
<?php$dir = opendir("images/");while ($file = readdir($dir)) {if ($file=="." or $file=="..") continue;$string.= $file;$string.= ", ";}echo "imgList=".$string;?>
I will catch the array in flash with this AS-code:
Code:
lv = new LoadVars();
lv.load("imagearray.php");
lv.onLoad = function(success) {
if (success) {
pArray = this.imgList.split(", ");
}
else {
trace("could not load file");
}
}
It works fine, except for one thing, when I first visit my site, the array is empty, it takes some surfing time on the site before the arrays start to work.
I have found out that I get this message when I trace the path:
Quote:
Error opening URL "http://www.mysite.com/mysite/image.jpg"
Do u think it's due to the server itself or the PHP ?
2.I get the images through the array on my site, now I wonder how I can create a dynamic image thumbnail scroller, the kind that moves the list with thumbnails to the left when the cursor enters the right side of the thumbnail row. This have been discussed before, but it always seem to require an xml-file, which I don't use (to be honest, because I can't see the benefit of it )
The problem is that all the thumbnails has to be dynamicly loaded into the "slideshow", i.e. read from the array and placed with a correct size, 40x40...
I would really appreciate some help here, have been working on my site for ages now, want to publish it soon!
Thanx dudes...
/henrik, sweden
ps.can Scotty step in and save the day for a person in need once again?.ds.
View Replies !
View Related
Dynamic Image Gallery With XML
OK. I know that there are tutorials on image galleries (both using an array and XML), and I have read tons of threads, including Scotty's great sticky one that summarizes all of the XML options. The one I am most interested in is the one that creates a PHP that automatically creates an array that is loaded into the flash file - this way I can just upload new images into a new folder and update the site very easily.
I can get this to work fine, however my server doesn't support PHP (I know that is a whole other issue in itself but bear with me).
That being siad, is there a way to do the same thing with XML - that is get it to automatically list the image names instead of needing to type in the names in a new file with every update?
Thanks for the help.
View Replies !
View Related
Dynamic Image Gallery
I have loaded a series of dynamic images from a database into a thumbnail movie clips. Once clicked the thumbnail will open its image in larger dimensions.
Is there anyway to use the existing image data already preloaded in the thumbnail. At the moment it is loading twice.
Essentially is there anyway of getting the contents of one movie clip and putting it into another?
Many thanks
Jamie
View Replies !
View Related
Dynamic Image Gallery Help Needed
I am looking to do a photo gallery on a website that will be updated with new photos frequently. Does anyone have any samples or a direction that I can be pointed in that would allow me to quickly add photos (or change photos) in a gallery with minimal coding (or just change image file names).
Thank you in advance for any help!
Mark
View Replies !
View Related
Dynamic Image Gallery Question
Hi,
I am uing an array to create a gallery of images. This is the code I am using.
var gallery = new Array();
gallery = [ "img1.jpg", "img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg"];
var textGallery = new Array();
textGallery = [ "This is the caption for image one.", "This is the caption for image two.", "This is the caption for image three.", "This is the caption for image four.", "This is the caption for image five.","This is the caption for image six."];
function buildThumbnails(colCount) {
trace("buildThumbnails");
// keep track of where the nav sits
var navX = 10;
var navY = 40;
var padding = 90;
// we look to see how many thumbs we need
var totalCount = _root.gallery.length;
trace(_root.gallery.length)
// keep track of column and row
var col = 0;
var row = 0;
// start our attach
for (i=0; i<totalCount; i++) {
// attach the object
var current = _root.attachMovie("thumbnail.src", "thumb"+i+"_mc", i );
// do we need to rest the column and up the row?
if ( ((i%colCount) == 0) && (i != 0) ) {
trace(i%colCount);
col= 0;
row++;
}
// now position the parts!
current._x = navX+(padding*col);
current._Y = navY+(padding*row);
current._alpha = 50;
// pass an id into each thumbnail (make new var in each one called id)
current.id = i;
current.onRelease = function () {
_root.showImage(this.id);
//trace(i);
_root.display_txt.text = _root.textGallery[this.id];
}
current.onRollOver = function () {
this._alpha = 100;
this.gotoAndStop(2);
}
current.onRollOut = function () {
this._alpha = 70;
this.gotoAndStop(1);
}
// load some thumbnail art
current.loadzone_mc.loadMovie( "thumb/" + _root.gallery[i] );
current.display_txt.text = _root.gallery[i];
// and up the column so the next one moves over
col++;
}
}
function showImage ( choice ) {
trace("showImage for "+choice);
_root.loadzone_mc.loadMovie( "normal/" + _root.gallery[choice])
_root.display_txt.text = _root.textGallery[0];
}
function init () {
trace("init");
// call the build thumbnail function
buildThumbnails(6);
showImage(0);
}
init ();
This works perfectly. My question is this how do I load a second gallery using the same script. Do I need a second array? Basically I want two buttons, gallery1 and gallery 2. They will load new thumbnails into the same position as the original thumbnails.
Thanks
View Replies !
View Related
Positioning In Dynamic Image Gallery
Hi
I have built a dynamic image gallery that works brilliantly except that the loaded image falls in the top left corner of the container.......which i have a feeling there is not much i can do about.
So is there a way of determining the image size and work off that so that I can adjust the area for the image so that it can be centralized irrespetive of image shape.
i hope you know what i mean. ( i also hope i know what I mean?)
View Replies !
View Related
[MX04] Dynamic Image Gallery
Hi,
I am having trouble finding a good resource for this matter. I want to code it myself so I can customize later down the road. I would like to dynamically make an image gallery using PHP and Flash. I have tested a few different things, but I can't figure out how to put the pieces together. I have no problem with the PHP part, I just need help fitting the Actionscript to work. This is what I have that might work:
Code:
createEmptyMovieClip("image_clip", this.getNextHighestDepth());
createEmptyMovieClip("image_clip2", this.getNextHighestDepth());
var imagegallery:Array = Array();
varLoader = new LoadVars();
varLoader.load("PHPfile.php");
varLoader.onLoad = function(success) {
if(success) {
imagegallery['thumb1'] = thumb1;
imagegallery['thumb2'] = thumb2;
} else {
trace('Error loading the PHP file');
}
}
image_clip.loadMovie(thumb1);
image_clip2.loadMovie(thumb2);
PHP file:
PHP Code:
<?php
$thumbpath = "www.fakedomain.com";
for ($count = 1; $count < 3; $count++) {
$output .= "&thumb" . $count . "=" . $thumbpath . "thumb" . $count . ".jpg";
}
echo $output;
?>
I want to make a loop eventually in Flash (I can probably do myself, but just warning those who might help) that automatically makes the movies and their images. I have a problem with the calling of the Flash variable thumb1 and thumb2. I also want to be able to make sure that when the images are loading, I can put a preloader. I do want the images to align in a grid not just everywhere, so I might not dynamically make the empty movie files, but I still need help with this. Also, I want to make a rollover effect, so help with that part would also be appreciated. I do want to avoid using XML due to my lack of knowledge on it, but I will if I have to.
View Replies !
View Related
SIMPLE Non-dynamic Image Gallery
Hi there,
As always, the world of Flash has moved on and developed new classes like MovieClipLoader since last I did a site. Before I invest the time, I just want to be sure I can't do something SIMPLE for my portfolio gallery without relying on too much fancy new stuff. I'm in a bit of a hurry you see.
Each gallery will be an externally loaded swf. The gallery layout is simple - a big image, with a row of little thumbnails underneath. I thought I could eliminate the need for pre-loaders etc. by trying to work with the linear nature of how flash loads an external swf:
Functionally I'd like to see the first big image appear and it's thumbnail, then the other thumbnails appear along the bottom WHEN their larger versions are loaded into the player (thus letting the user know what is ready to view). If my thumbnails are just scaled instances of my large images, this relationship would SEEM easy to exploit - if the player loads a large image, it's thumbnail appears or vice versa. Yet I'm stuck.
If an external swf. has an image on each frame, I know it will just chug along and loading and displaying them as they load. This mechanism (visible or not) will eventually load them into the player (max. 20 images) and I believe that should the user jump the playhead to a frame that hasn't yet loaded, it will be blank - in which case a simple looped 'loading' animation on the layer below would suit me fine.
Assuming I used this mechanism to populate my thumbnail bar. How could I work it so that clicking on the thumbnail button would display the larger version ? The normal mechanism would be a movieClip with the larger versions in it and a gotoAndStop(x) ... though when flash sees a mc on a frame it won't display anthing until it's fully downloaded it's contents, so that's out.
I guess I have to dynamically (?) call and postion images/instances already loaded into the player ... ? I dunno.
Any suggestions ?
If there's a simple solution, I'd love to hear it.
Cheers,
Morgan
View Replies !
View Related
|