Image Sizes & Thumbnails
Hi there, just a basic question:
In my project I´ve large images, which needs some thumbnails, too. What would you do: Scale them down in flash with actionscript or to create the thumbnails in photoshop prior to use?
Thanks!
FlashKit > Flash Help > Flash Newbies
Posted on: 11-28-2003, 08:30 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
XML Generated Thumbnails Of Different Sizes
Hey:
I am generating thumbnails from xml which will have different heights. I'm just trying to figure out the math of that. Currently they are placing 10px between either the maximum height or the minimum height, but is there a way to figure a unique height for each thumbnail?
Any help would be appreciated.
Thanks
Actionscript Gallery: Thumbnails Different Sizes?
I followed Kirupas tutorial on making a gallery with thumbnails. However, each thumbnail has to be of same width....if not the order of the thumbs gets mixed up. I'v been trying to figure this out for a while, but i'm not as smart as you guys.....
Iv been trying to alter the thumbnails_fn(k) function, or more precisely this line:
target_mc._x = hit_left._x+(target_mc._width+5)*k;
The tutorial im talking about is this one:
http://www.kirupa.com/developer/mx2004/thumbnails.htm
Anyone know how to do this?
Cheers,
David
Dynamic Loading Of Pics In Various Sizes With Thumbnails
Hi!
I'll try to explain the problem, but it's kinda complicated.
OK, I have this external XML with url to jpgs and url to thumbnails respectively. I load them into temporary containers, as you would in a slideshow, and then I link the thumbnails to the pictures. The problem is, I create the links to the position/instance in the array where the picture is put. And, since a jpg at 500 kb is five times as large as one at 100 kb, and therefore will place itself later in the array, the array is totally f***ed up. Hence, the thumbnails will link to the wrong picture.
Basically, I want a way to load the pictures into the array once the actual data is loaded, not when the temp holder is created or when flash has FOUND the picture.
Once again, I want the order in the array to be 0,1,2,3,4,5 and not 4,3,6,1,2,3, but a simple sorting function doesn't work. Probably because I load all the pictures on the same time.
My guess is that I would have to create a stop or something to prevent the second image to start loading before the first is done, and so on. BTW, I use a MovieClipLoader...
Simple Gallery Example Flash With PHP Serving Image List And Image Sizes
this is simple gallery example for AS2
gallery is nothing special ease to use and implement
interesting thing about this example is that you pass a folder, and PHP side gathers images list from folder and returns it to Flash in XML form together with images widths and height which makes it more easier to implement this sort of galleries like I've made
example : http://www.hagane.us/as/gallery/
ZIP : http://www.hagane.us/as/gallery/gallery.zip
blogpost : http://mrsteel.wordpress.com/2008/01...s-from-folder/
Printing Image Sizes
Hi,
I have a flash movie that displays pictures and allows users to print them out. This works fine. The only problems is that I want to determine the size of the output, ie. fill the page, etc. Is there any way to do this,
Thanks in advance,
Pete,
www.plexusdesigns.co.uk
RollOver Image, Help On Sizes.
hi,
we are tring to clone this : http://www.jeffreyhein.com/welcome.html . please visit it and watch the rollOver effect. see how thumbnails get bigger with not spotting a difference in the image quality ?
then, go to my sample at http://nozilla.org/radu/resize/ and see how things get "nasty" when i rollOver after the thumbnail gets a bit bigger? firstly is set to 80x80 and i resize it to 95x95. can you tell me how they did it so there is no quality difference between initial thumbnail and second rolled thumbnail. my thumbnails are loaded from XML, maybe Jeff's are not ? maybe ? can you help me ?
thanks a lot
LoadMovie And Image Sizes
Hey,
I'm trying to dynamically load an image into a movieclip and then scale it to fit.
Loading the image using loadMovie isn't difficult, what I can't figure out is how to resize the loaded image to match either the width or the height of the movieclip depending on the proportions of the image.
How would I go about doing this?
thanks
RollOver Image, Help On Sizes.
hi,
we are tring to clone this : http://www.jeffreyhein.com/welcome.html . please visit it and watch the rollOver effect. see how thumbnails get bigger with not spotting a difference in the image quality ?
then, go to my sample at http://www.nozilla.org/radu and see how things get "nasty" when i rollOver after the thumbnail gets a bit bigger? firstly is set to 80x80 and i resize it to 95x95. can you tell me how they did it so there is no quality difference between initial thumbnail and second rolled thumbnail. my thumbnails are loaded from XML, maybe Jeff's are not ? maybe ? can you help me ? my images look very pixelate when i bring them to 95x95
thanks a lot
Image Sizes Related To Browser
I am trying to build a nav bar in Fireworks that will go horizontal across the entire browser. I recommend browsing in 1024x768 on the site. So, what stage size would I use in Fireworks or Flash to accompish this when i import it into Dreamweaver to build the site?
Thanx.
If this is in a tutorial or you know of basic layout tutorials, can you please let me know. Thanx.
Adjusting Loaded Image Sizes
I'm trying to load a jpeg and resize it to fit the screen. I load the jpeg into an empty movie, which works fine, but I can't resize the picture to fill the screen. Does anyone know how to do it?
My code which isn't working is:
loadMovie(myLocal_so.data.backimage,_root.backimg) ;
setProperty("_root.backimg", _width, 700);
setProperty("_root.backimg", _height, 550);
*myLocal_so.backimage is the path + filename of the jpeg
the movie is 700x550
Dynamically Changing Image Sizes
If anyone could clue me in on if there is a way to dynamically change the size of images in your flash movie. In other words, if I am using thumbnail pics on each frame, can I just have it call an image and then resize it when it is imported to my movie. This would make it a lot simpler than having to resize each picture in an editing program every time I need to create a new thumbnail. Any help would be greatly appreciated.
Brian Walsh
Will Flash Optimize Image Sizes?
Hello again everybody :)
I have a question about the optimization of pictures placed in a Flash stage.
If I put a big sized pictures (for example: 1024 x 1024) and if, in the final result, the picture is downscaled on the Flash stage (for example : 200x200 pixels), once the swf is created , will the picture be as heavy as before it was downscaled, when the flash web site will be loaded in browsers?
Thanks
Gz
Resize The Stage To Match Image Sizes
I have a simple Document Class file which will load a different sized .gif image at runtime by referencing XML data loaded to it with a URLLoader. The XML, includes width and height tags giving the image's dimensions. I use these dimensions to set width and height variables in the document class file.
I then need to use the variables to dynamically change the size of the SWF that displays at runtime to exactly match the uploaded image's size. The SWF is embedded in an HTML page, which uses the same variable data to set the dimensions for the embedded SWF object.
Does anyone know how to code AS3 such that it take the dimensions varialbes and change the stage size?
Loading Image With Random Sizes But Same Place
hello!
i have a swf with a list of images on the left and what i want to do is when i click in the image , it will creat an empty movieclip and send an image inside.
i know how to do this, but the problem is that i have a 300x200, 200x300 and another sizes, but the max width and hiehgt is 300x300, so i need a 300x300 movieclip and my dificultie is to make the images stay exactly in the middle of the invisible movieclips o they dotn load around places i dont want to
im trying with this:
// creating clips
this.createEmptyMovieClip("containerFoto", this.getNextHighestDepth());
containerFoto.createEmptyMovieClip("foto", containerFoto.getNextHighestDepth());
var fotoLoader:MovieClipLoader = new MovieClipLoader();
fotoLoader.loadClip("imagens/fotos/1.jpg", containerFoto.foto);
containerFoto._visible = false;
//trying to get the width and height of the just loaded image
var novaWidth:Number = containerFoto.foto._width;
var novaHeight:Number = containerFoto.foto._height;
if (novaWidth <=300){
containerFoto. _x = 400;
} else{
containerFoto._x = 250;
}
containerFoto._visible = true;
in this code the problem is that im notgettting the width and hieght of the image.
annyone knows a simple way to do this? thanks and if you dont understand something plz tell
thanks in advance!
True Image Sizes Visible Only When Zoomed In
Hello everyone,
Compleate newbie to Flash here so pardon the ignorance.
Inherited a small flash file and trying to Import some new images into it ...a simple slide show concept.
Whenever I import an image it seems that its 'true size' is not inserted into a document but rather some resized version of it.
Ones the movie is exported image remains 'small'. Only after I manually zoom into the movie the image sharpness and size is revealed to what it should be before Flash...only now I can see a small percentage of the whole movie due to zoom.
Also original image is:
JPG 260 x 790 px
while in Flash it is imported as:
BMP 93.6 x 258.9 px
So to ask bluntly what is Flash doing to my images? Is there a setting that I am missing here? Again, my flash experince is equal to going through builtin tuts and lessons
Suddenly DW icon looks a lot better than FL :)
Thanks for your time!
All the best!
:--------------------------------------:
All around in my home town,
They tryin' to track me down...
Standalone Question: How 2 Keep Fixed Image Sizes?
I did some work in Flash and had the work distributed on a CD ROM.
I made a standalone Flash projecter file.
The problem is: the work looks fine on my flat screen 15" monitor.
When you take the work to a different size monitor... the work looks a bit out of place. : (
How can I force Flash to keep the correct size?
I read that you can do this in Flash MX.
(But I can't remember where I saw it!)
Any help would be appreciated.
Thanks.
Jam
Flash 8 - Help W Xml Image Gallery, Thumbnails For Each Image
Hey.
New here and have found some really good tutorials! Thanks.
I desperately need a bit of help with some Actionscripting if anyone has any ideas how to do this?
I have created a photo gallery using the kirupa tutorial. That works fine. Now for each main image that the code cycles through my client wants 1-3 thumbnails to display on the side of the image and they should all be clickable and display full size in place of the main image when clicked. The previous and next buttons should still only go through the main images. Here is the xml code (as I imagine it should look like):
[code]
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>images/bowandkey_main.jpg</image>
<caption>Bow and Key Necklace: £225.00</caption>
<description>Mother of pearl (or onyx) necklace with silver-plated bow and key, cast from vintage originals </description>
<thumbnail>
<thumb1>thumbnails/bowandkey_main.jpg</thumb1>
<thumb2>thumbnails/bowandkey_portrait.jpg</thumb2>
<thumb3>thumbnails/bowandkey_closeup.jpg</thumb2>
</thumbnail>
</pic>
<pic>
<image>images/bowandkey2_main.jpg</image>
<caption>Bow and Key Necklace: £230.00</caption>
<description>Onyx necklace with silver-plated bow and key, cast from vintage originals </description>
<thumbnail>
<thumb1>thumbnails/bowandkey2_main.jpg</thumb1>
<thumb2>thumbnails/bowandkey2_portrait.jpg</thumb2>
</thumbnail>
</pic>
<pic>
<image>images/crossedfingers.jpg</image>
<caption>Crossed Fingers Necklace: £150.00</caption>
<description>Solid silver crossed fingers good luck charm, cast from 1940s celluloid gumball toy, strung on mother of pearl or onyx beads.</description>
<thumbnail>
<thumb1>thumbnails/crossedfingers_main.jpg</thumb1>
<thumb2>thumbnails/crossedfingers_closeup.jpg</thumb1>
</thumbnail>
</pic>
</images>
The thumb 1,2 and 3 are childNodes of thumbnail.
I have created a MovieClip holder to hold the thumbnails. Could someone please show me how to add to the Actionscript so that it loops through (displays) the thumb1 - thumb 3 for each main image? I suppose I would have to store the thumbnails for each image in separate folders so the flash can determine the length of the array of thumbnails for each image? And then make them clickable.
I am pulling my hair out here not getting this working... Any hinters on what to do would be greatly appreciated!
Here is the actionscript code for the image gallery:
Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
caption = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
caption[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
cap_txt.text = caption[p];
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
cap_txt.text = caption[p];
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
cap_txt.text = caption[0];
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
Thanks!!
Image Sizes In Library - Should I Convert Images Back To Gifs?
I have an animated Flash file with a lot of images that I had to "convert to bitmap" in order to use Flash to clean up the edges and get rid of white artifacts (due to semi-transparent pixels at the edges when the background was removed). The images were originally scanned and have a lot of line drawing in them so I had to use the maximum settings (very tight corners etc.) to convert them. The quality is excellent.
Problem is, the fla file is nearly 8MB now. With all that vector drawing in there it takes forever just to do a test movie. I wonder if I should screen capture each image - take them into Photoshop, resave them as gifs with a transparent background, and import them back into Flash. Any ideas?
Thanks
Charles
Large Image File Sizes - Should I Convert Images Back To Gifs?
I have an animated Flash file with a lot of images that I had to "convert to bitmap" in order to use Flash to clean up the edges and get rid of white artifacts (due to semi-transparent pixels at the edges when the background was removed). The images were originally scanned and have a lot of line drawing in them so I had to use the maximum settings (very tight corners etc.) to convert them. The quality is excellent.
Problem is, the fla file is nearly 8MB now. With all that vector drawing in there it takes forever just to do a test movie. I wonder if I should screen capture each image - take them into Photoshop, resave them as gifs with a transparent background, and import them back into Flash. Any ideas?
Thanks
Charles
CSS Sizes Do Not Correspond With Flash's Internal Sizes, Please Help
This is highly upsetting!
The sizes I'm setting with CSS for my Textfield do not AT ALL correspond with the size I would get if, using the same number, specificed directly through the interface. In short, a font-size:8 in a CSS file read by Flash produces far bigger type than type with size 8 set in Flash itself. In fact, the Flash CSS interpreter produces bigger type than ANY other program does for this value. What this means is that, using pixel fonts which needs to be 8px exactly, is IMPOSSIBLE, because the Flash CSS interpreter reads and interprets the size in a completely nonsensical way.
Please tell me I'm wrong?
Help With XML Thumbnails And First Image
This is a Re-post. I built a XML image gallery and I'm trying to do two things:
The first thing is to have the thumbnails start with an alpha of .5, then on MOUSE_OVER increase the alpha to 1 and remain on 1 until another image is selected.
The Second thing is to have the gallery load image 1 from the list automatically (from load).
I apologize for my lack of knowledge and would appreciate yours.
Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var fadeTween:Tween;
var imageText:TextField = new TextField();
var textStyle:TextFormat = new TextFormat();
var textStyle2:TextFormat = new TextFormat();
var textStyle3:TextFormat = new TextFormat();
var textStyle4:TextFormat = new TextFormat();
var imageLoader:Loader;
var imageLoader2:Loader;
//imageLoader.load(new URLRequest("thumbnails/image3.jpg"));
var xml:XML;
var xmlList:XMLList;
var xmlList2:XMLList;
var xmlLoader:URLLoader = new URLLoader();
var xmlLoader2:URLLoader = new URLLoader();
textStyle.font = "Myriad Pro";
textStyle2.color = 0x666666
textStyle3.kerning = true;
textStyle4.size = 11;
xmlLoader.load(new URLRequest("data/images1.xml"));
xmlLoader2.load(new URLRequest("data/images2.xml"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader2.addEventListener(Event.COMPLETE, xmlLoaded2);
function xmlLoaded(event:Event):void {
xml = XML(event.target.data);
xmlList = xml.children();
for (var i:int = 0; i < xmlList.length(); i++) {
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
imageLoader.x = 0;
imageLoader.alpha = .5;
imageLoader.y = i * 72 + 1;
imageLoader.name = xmlList[i].attribute("source");
addChild(imageLoader);
imageLoader.addEventListener(MouseEvent.MOUSE_OVER, moreAlpha);
imageLoader.addEventListener(MouseEvent.CLICK, showPicture);
}
}
function moreAlpha(event:MouseEvent):void{
for (var j:int = 0; j < xmlList.length(); j++) {
if (xmlList[j].attribute("thumb") == event.target.name) {
imageLoader.alpha = 1;
}
}
}
function xmlLoaded2(event:Event):void {
xml = XML(event.target.data);
xmlList2 = xml.children();
for (var i:int = 0; i < xmlList2.length(); i++) {
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList2[i].attribute("thumb")));
imageLoader.x = 103;
imageLoader.alpha = .5;
imageLoader.y = i * 72 + 1;
imageLoader.name = xmlList2[i].attribute("source");
addChild(imageLoader);
imageLoader.addEventListener(MouseEvent.CLICK, showPicture);
}
}
function showPicture(event:MouseEvent):void {
imageLoader = new Loader();
imageLoader.load(new URLRequest(event.target.name));
imageLoader.alpha = 1;
imageLoader.x = 208;
addChild(imageLoader);
//imageOne.visible = false;
imageText.x = imageLoader.x;
imageText.y = 432;
for (var j:int = 0; j < xmlList.length(); j++) {
if (xmlList[j].attribute("source") == event.target.name) {
imageText.text = xmlList[j];
}
}
for (var p:int = 0; p < xmlList2.length(); p++) {
if (xmlList2[p].attribute("source") == event.target.name) {
imageText.text = xmlList2[p];
}
}
fadeTween = new Tween(imageLoader,"alpha",Strong.easeInOut,0,1,1,true);
}
imageText.autoSize = TextFieldAutoSize.LEFT;
addChild(imageText);
imageText.setTextFormat(textStyle);
imageText.defaultTextFormat = textStyle;
imageText.defaultTextFormat = textStyle2;
imageText.defaultTextFormat = textStyle3;
imageText.defaultTextFormat = textStyle4;
Cheers,
Karnuckle
XML Image Thumbnails
Hello guys. I was going through the tutorial on 'XML image gallery with thumbnails' and it was introduced with the thumbnails listed on sidescroll.
What if I require the thumbnails to be displayed in 8 per row, 5 columns and whenever thumbnails > 40 it will auto scroll down ? which part of the code I need to change ?
Appreciate any kind soul's assistance
Image Thumbnails
Hi all!,
I am currently creating a Flash Image
Gallery with thumbnails. On top of that,
I am also planning to include 'next' & 'prev'
buttons and when clicked, a pointer or an arrow
will be shown on the thumbnail indicating the
next/previous selected image >> like this website
Does anyone know how it can be done?
Appreciate all the help.........thanx! ^_^
-regards
External Thumbnails And Image
Hi here is the code and the flash file:
The file is not working, do you know why?
/********* DECLARE AND INITIALIZE VARIABLES **************************/
// names of folder and pictures, in the order to put them into the thumbnails holder
var picnames:Array = [
"flower_orange",
"flower_yellow",
"flower_pink",
"flower_red",
"flower_purple"];
// constants
var PICPATH:String = "flowers/";// folder with jpgs
var NPICS:Number = picnames.length;// number of pictures to load
var PICX:Number = 10; // x loc of big picture
var PICY:Number = 10; // y loc
var THUMBHOLDERX:Number = 0; // x location of thumbnail holder movieclip
var THUMBHOLDERY:Number = 230; // y location
var THUMBW:Number = 72; // width of each thumbnail
var THUMBH:Number = 40; // height
var MARGIN:Number = 10; // margin between thumbnails
var TOTALBYTES:Number = 106000; // approx sum of bytes in all jpgs
var totalloaded:Number = 0; // running tally of bytes loaded from all pics
// index into pictures array, used for loading
var ipic:Number;
// set up loader, an instance of MovieClipLoader
var loader:MovieClipLoader = new MovieClipLoader();
// use the main timeline to listen to and respond to loader's broadcast events
loader.addListener(this);
/********* DEFINE FUNCTIONS, INCLUDING INIT FOR MOVIE SETUP **********/
// thumbnail rollover handler
function grow() {
this.onEnterFrame = function() {
if (this._width < THUMBW * 1.2) {
this._x -= this._width * .025;
this._y -= this._height * .025;
this._width *= 1.05;
this._height *= 1.05;
} else delete this.onEnterFrame;
};
}
// thumbnail rollout handler
function shrink() {
this.onEnterFrame = function() {
if (this._width > THUMBW) {
this._width /= 1.05;
this._height /= 1.05;
this._x += this._width * .025;
this._y += this._height * .025;
} else delete this.onEnterFrame;
};
}
// thumbnail click (onrelease) handler
function openPic() {
pic_mc.loadMovie(PICPATH + picnames[this.i] + ".jpg");
}
// assign event handlers (called when all jpgs are loaded)
function setupHandlers() {
pct_txt.removeTextField();// don't need loading indicator any more
for (var i:Number = 0; i < NPICS; i++) {
thumbs_mc["mc"+i].onRollOver = grow;
thumbs_mc["mc"+i].onRollOut = shrink;
thumbs_mc["mc"+i].onRelease = openPic;
}
}
// listener function for broadcast 'done' message (for each pic)
// onLoadInit gets executed when the movieclip has been loaded into _mc AND
// its width and height data are available.
// (_mc = the movieclip being loaded into)
// this routine sets the size and position of each thumbnail clip as its jpg
// is loaded and starts the next one loading. When all have been loaded,
// a random picture is loaded into pic_mc and setupHandlers is called to
// assign handlers to each thumbnail movieclip
function onLoadInit(_mc:MovieClip) {
// this gets done when the jpg is completely loaded:
_mc._width = THUMBW;
_mc._height = THUMBH;
// give the movieclip a property to remind it who it is
// (used by openPic to know which big picture to open)
_mc.i = ipic;
// add picture size to totalloaded variable
totalloaded += loader.getProgress(_mc).bytesTotal;
// now load the next one (if there are more) or set up handlers if done
ipic++;
if (ipic == NPICS) {
// start with a random photo displayed
pic_mc.loadMovie(PICPATH + picnames[Math.floor(Math.random()*5)] + ".jpg");
setupHandlers();
} else {
loader.loadClip(PICPATH + picnames[ipic] + ".jpg", thumbs_mc["mc"+ipic]);
}
};
// listener function to handle broadcast progress messages
// make pct_txt show cumulative loading progress
function onLoadProgress(_mc:MovieClip, loaded:Number) {
var loadedsofar:Number = totalloaded + loaded;
pct_txt.text = Math.floor(loadedsofar / TOTALBYTES * 100) + "%";
};
// things to do to set up the stage and start the movie:
// create holders for the pictures and thumbnails
// create and format progress-indicating textfield
// create individual holder movieclips for each thumbnail within the thumbnail holder
// start the pictures loading with loadClip
function init() {
// create holder for pictures
createEmptyMovieClip("pic_mc", 1);
pic_mc._x = PICX;
pic_mc._y = PICY;
// create (and draw) holder for thumbnails
createEmptyMovieClip("thumbs_mc", 2);
thumbs_mc.beginFill(0, 100);
thumbs_mc.moveTo(0, 0);
thumbs_mc.lineTo((MARGIN + THUMBW) * NPICS, 0);
thumbs_mc.lineTo((MARGIN + THUMBW) * NPICS, THUMBH + 2 * MARGIN);
thumbs_mc.lineTo(0, THUMBH + 2 * MARGIN);
thumbs_mc.endFill();
thumbs_mc._x = THUMBHOLDERX;
thumbs_mc._y = THUMBHOLDERY;
// create loading textfield indicator
createTextField("pct_txt", 3, 200, 100, 40, 100);
var tf:TextFormat = new TextFormat();
tf.align = "center";
tf.size = 12;
tf.font = "Verdana";
tf.color = 0xFFFF00;
pct_txt.setNewTextFormat(tf);
// make empty movieclips in thumbs_mc for each pic to go into
for (var i:Number = 0; i < NPICS; i++) {
var mc:MovieClip = thumbs_mc.createEmptyMovieClip("mc"+i, i+1);
mc._x = MARGIN + i*(MARGIN + THUMBW);
mc._y = MARGIN;
}
// set the pointer to the first jpg in the array picnames
ipic = 0;
// start loading jpgs
loader.loadClip(PICPATH + picnames[ipic] + ".jpg", thumbs_mc["mc"+ipic]);
}
/********* CALL THE INIT FUNCTION TO START THE MOVIE *****************/
init();
Image Gallery With Thumbnails
im really not sure what forum this is to go in.....hopefully here
what i want to do is create a type of photo gallery that has thumbnails becoming larger images when clicked on and then returning to thumbnail size when clicked again. what i tried to do was make each of the thumbnails a button and then just have the picture open in a new window but that wasn't what i wanted. i dont know the terms for any of these effects that i want, so if you can't understand me or just think visually...here's an aid...
thanks a bunch
Image Gallery With Thumbnails?
Hello!
Is there a more or less easy way to create an image gallery in flash that uses thumbnails as preview?
I mean: I'd like to have a collection of organised thumbnails (maybe even in a scroller? ) and when you scroll over a thumbnail (or you click on it) you see the large pic -in a frame or in a new window-
I'd like to use this to make the "pix" page of my band's site a bit more attractive.
I'd like to be able to make extra short galleries every time we have a new set of pictures.
I have NO idea how to begin this, and i actually didn't find much on the net to my surprise
Thanx!
dec
Loading A Image Over Thumbnails...
Hey Everyone,
Please help. Ive almost got what ive been trying to do for weeks.
i have a photo gallery from on of the "Kirupa" tutorials using xml, but this ones with a 5X4 grid.
I want only the grid to up on stage and when you click the thumbnail i want the larger image to show up over the grid!!and then a "back button" thats returns to the grid of images and so on.
I have everything in place i just need some help getting the depths right and a back btn back to grid of thumbs.
Ive been on this for weeks please help out.
This is my code so far.
cheers ck
thumbarray = [];
columns = 5;
spacex =92
spacey=60
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
sload()
} else {
content = "file not loaded!";
}
}
function drawSquare(thumb, depth, x, y, w, h) {
var mc = thumb.createEmptyMovieClip("thumb"+depth, depth);
//mc._x = x;
//mc._y = y;
//mc.lineStyle();
//mc.beginFill(colour)
//mc.lineTo(w, 0);
//mc.lineTo(w, h);
//mc.lineTo(0, h);
//mc.endFill();
return mc;
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("image.xml");
///////////////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() ==Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}}
Key.addListener(listen);
previous_btn.onRelease = function(){
prevImage();
}
/////////////////////////
next_btn.onRelease = function(){
nextImage();
}
///////////////////////////////////////////////
p=0;
this.onEnterFrame = function(){
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if(loaded!=filesize){
preloader.preload_bar._xscale = 100*loaded/filesize;
}else {
preloader._visible = false;
//if (picture._alpha<100){
//picture._alpha += 10;
}
}
//////////////////////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture.loadMovie(image[p], 1);
}}}
function prevImage() {
if (p>0) {
p--;
//picture._alpha = 0;
picture.loadMovie(image[p], 1);
}}
/////////////////////////////////////////////
function firstImage(){
if (loaded ==filesize){
picture._alpha =100;
picture.loadMovie(image[0],1);
}
}
function startload() {
thumbarray[ij].loadMovie(thumbnails[ij]);
checkload();
}
var ij=0
function sload() {
for (var i = 0; i<image.length; i++) {
var thumb = drawSquare(this, i, 0, 0, 0, 104, 71);
thumb._x =48+ (i%columns)*spacex;
thumb._y =82+ Math.floor(i/columns)*spacey;
var clap =thumb.createEmptyMovieClip("tt",1)
//clap._x = 2
//clap._y = 2
thumbarray.push(clap);
thumb.pictureValue =i;
thumb.onRelease = function() {
p = this.pictureValue-1;
nextImage();
}
thumb.onRollOver = function() {
this._alpha = 50;
}
thumb.onRollOut = function() {
this._alpha = 100;
}
}
startload()
}
this.createEmptyMovieClip("checker",1000)
function checkload() {
checker.onEnterFrame = function() {
if (thumbarray[ij]._width) {
delete this.onEnterFrame;
if (ij<thumbarray.length-1) {
ij++;
startload();
}
}
}
}
function startload() {
thumbarray[ij].loadMovie(thumbnails[ij]);
checkload();
}
Image Gallery With Thumbnails?
Hello!
Is there a more or less easy way to create an image gallery in flash that uses thumbnails as preview?
I mean: I'd like to have a collection of organised thumbnails (maybe even in a scroller? ) and when you scroll over a thumbnail (or you click on it) you see the large pic -in a frame or in a new window-
I'd like to use this to make the "pix" page of my band's site a bit more attractive.
I'd like to be able to make extra short galleries every time we have a new set of pictures.
I have NO idea how to begin this, and i actually didn't find much on the net to my surprise
Thanx!
dec
Image Gallery With Thumbnails
I've seen many websites with image galleries that have many thumbnails on one side and when you select a thumbnail the images loads on the other side. Can anyone point me to a tutorial or something so that I can try to create something like that?
Thanks
SOtey
Thumbnails Control Large Image...how?
I've noticed this a few places, but I was always curious as to how it is done.
An example is at
http://www.flaminglips.com/main.php
Go to 'Yoshimi Audio Player' button on the top right. (and hey, you can hear the whole album for free too, and it's a good one) What I am curious about is the image to the left, it's like it's 1 huge mc, with a bunch of images layed on it in different spots. Then when a thumbnail at the top is hit, the mc pans to reveal the larger version of the thumbnail.
It eases in and out of the images too.
I guess my question is, how do they do that?
thanks
ty
Need To Make Grid Of Image Thumbnails Appear
Howdy..
(noob alert)
I am making a slide show in which the user must be able to click an icon and have a grid of 25 or so image thumbnails appear - and naturally, each one must be clickable.
I imagine the thumbnails being on a layer which becomes visible and active when the button is clicked... but I may be thinking about this the wrong way... Should it actually be a movie clip or something?
I'm not really sure how to do this - I assume the images would be buttons which both close the "thumbnail layer" and cause the underlying slide show to jump to the right image.
Any help appreciated!
thx
Andrew
XML Loading Thumbnails And Main Image
hi guys! i just wanna ask, if it is possible to load a thumbnail image that you can set the dimension of each thumbs. what i mean is, i have an image 400x600. when it loads to thumbnails i want the size to be 80x100.-- and another image is 400x500 and when it loads to thumbs i want the size to be 80x80... Actually this is a flash gallery with thumbnails, that looks like this. Four Seasons Hotel Los Angeles at Beverly Hills - Photo gallery.
Thumbnails For Xml Driven Image Gallery...
Hi everybody,
i'm using the following script to create a thumbnails list for my
image gallery. Thumbnails are generated verticaly in a single column.
How can i change this to have them in two columns instead of one?
Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;
numimages = this.firstChild.childNodes.length;
spacing = 85;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = company.texto.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._y = i*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
myPhoto.load("../images/collection/piclist.xml");
stop();
Thanks in advance.
Xml Image Gallery With Next And Previous And Thumbnails
hello,
I am trying to make an xml image gallery with previous and next buttons, but also with thumbnails. The problem is that the previous and next button work, and the thumbnails work also, but only when used separately.
When I click a thumbnail and than hit the previous or next button the next buttons continue beyond the thumbnails.
I will thus need a way to detect which imagenode is loaded whenever a thumbnail is clicked, so I can continue from there with the next and previous button.
Now the next and previous button start from the first node: firstImageNode = rootNode.firstChild;
They should start from a node that is determined by which thumbnail is clicked.
Does anyone know which action to add to my thumbnail buttons to reset the starting point, when they are clicked?
Thanks in advance!
Flash Image Gallery Thumbnails
Ok...
So i built myself an image gallery where you could click a next button and the next image would be displayed. VERY simple. Now i have decided to make thumbnails. I have an xml file, and i want to automatically load each thumbnail onto the stage where i want it. If possible i want these thumbnails not to be a seperate image, but a scaled down version of the original. Also, i obviously want to be able to scroll, i dont care how (buttons or scrollbar etc.), the thubnails if there are too many thumbnails to fit.
How would i go about doing something like this?
Cheers
Missaligned Thumbnails In Image Gallery
I've noticed that IE 5 on the Mac shows my image gallery (based on Scotty's V3 thumbs scrolled fla) thumbnails in some messed up fashion. You can see that the thumb borders (thin black line, I haven't removed them yet even though the background is black) are all in order, it's just the thumbnail that has a aligning problem. In Safari, IE 6 (PC) and Firefox, I don't have this problem except for the one occasional thumbnail that has been out of line. The fact that it's happening all the time in IE 5 doesn't concern me that much (it may be some funky IE problem) but since I've seen it occasionally happen with Safari (only one thumbnail out of line, no more) I'm wondering what's causing this? Could it be the browser or is it my flash code?
XML Image Gallery Thumbnails Position
Hello!
I have been reading the forums here but have not yet posted. Ive used the XML image gallery from this site very successfully several times.
What i'd like to know is, can the position of the thumbs be changed? e.g can the thumbs run vertically so they run down the side of the picture? And if so, how?
Ive searched the forum and cant find an answer to this, but apologies if it has already been covered.
Thanks for your help
Loading Thumbnails From Main Image
Hey there, first of all great forum, have learned a lot from you guys.
My problem:
Ive been doing the add thumbnail tutorial (http://www.kirupa.com/developer/mx2004/thumbnails.htm) and am no trying to modify the gallery.
I have linked the thumbnail array to the main image and resized the target_mc. Now i just cant get the thumbnails to sit at the right spot. What do i have to do?
thanks for your help
Robin
XML Loading Thumbnails And Main Image
hi guys! i just wanna ask, if it is possible to load a thumbnail image that you can set the dimension of each thumbs. what i mean is, i have an image 400x600. when it loads to thumbnails i want the size to be 80x100.-- and another image is 400x500 and when it loads to thumbs i want the size to be 80x80... Actually this is flash gallery with thumbnails, that looks like this. Four Seasons Hotel Los Angeles at Beverly Hills - Photo gallery.
Preloaders For Thumbnails In An XML Image Gallery
Hi guys,
I have this XML gallery pretty much set up except I need to put preloaders on both the thumbnails and the large images when they come in. Can anybody help me out with this on where I should put the preloader code, and how to possibly code it, so the preloaders will work on the individual thumbnails as well as the large images. I wanted to make a custom preloader, something simple like a circle that's masked off.
import fl.containers.UILoader;
import caurina.transitions.*;
//---------loading the external xml file-------
var urlRequest:URLRequest = new URLRequest("pics.xml");
var urlLoader:URLLoader = new URLLoader();
var myXML:XML = new XML();
var xmlList:XMLList;
myXML.ignoreWhitespace = true;
urlLoader.addEventListener(Event.COMPLETE,fileLoaded);
urlLoader.load(urlRequest);
//--------holds the paths to the thumbnails-------
var arrayURL:Array = new Array();
//--------holds the paths to the big photos-------
var arrayName:Array = new Array();
//--------holds the thumbnail objects-------
var holderArray:Array = new Array();
//--------represents the number of collumns-------
var nrColumns:uint = 7;
//-------represents the container of our gallery
var sprite:Sprite = new Sprite();
addChild(sprite);
var thumb:Thumbnail;
//-------- the thumbnails container-------
var thumbsHolder:Sprite = new Sprite();
sprite.addChild(thumbsHolder);
//--------Alpha tween in thumbs holder-------
thumbsHolder.alpha = 0;
Tweener.addTween(thumbsHolder, {alpha:1, time:1, transition:"linear"});
//-------- the photoLoader container-------
var loaderHolder:Sprite = new Sprite();
loaderHolder.graphics.beginFill(0x040a10,1);
loaderHolder.graphics.drawRect(0,0,830,700);
loaderHolder.graphics.endFill();
loaderHolder.x = 1000;
loaderHolder.y = 10;
sprite.addChild(loaderHolder);
//-------- loads the big photo-------
var photoLoader:UILoader = new UILoader();
photoLoader.width = 800;
photoLoader.height = 680;
photoLoader.y = 0;
photoLoader.x = 20;
photoLoader.buttonMode = true;
photoLoader.addEventListener(MouseEvent.CLICK,onClickBack);
loaderHolder.addChild(photoLoader);
/* we loop through the xml file
populate the arrayURL, arrayName and position the thumbnalis*/
function fileLoaded(event:Event):void {
myXML = XML(event.target.data);
xmlList = myXML.children();
for (var i:int=0; i<xmlList.length(); i++) {
var picURL:String = xmlList[i].url;
var picName:String = xmlList[i].big_url;
arrayURL.push(picURL);
arrayName.push(picName);
holderArray[i] = new Thumbnail(arrayURL[i],i,arrayName[i]);
holderArray[i].addEventListener(MouseEvent.CLICK,onClick);
holderArray[i].name = arrayName[i];
holderArray[i].buttonMode = true;
if (i<nrColumns) {
holderArray[i].y = 100;
holderArray[i].x = i*110+92;
} else {
holderArray[i].y = holderArray[i-nrColumns].y+110;
holderArray[i].x = holderArray[i-nrColumns].x;
}
thumbsHolder.addChild(holderArray[i]);
}
}
//----handles the Click event added to the thumbnails--
function onClick(event:MouseEvent):void {
photoLoader.source = event.currentTarget.name;
Tweener.addTween(thumbsHolder, {x:0, time:1, transition:"easeIn"});
Tweener.addTween(loaderHolder, {x:10, time:1, transition:"easeOut"});
Tweener.addTween(thumbsHolder, {alpha:0, time:1, transition:"linear"});
Tweener.addTween(loaderHolder, {scaleX: 1, scaleY: 1, alpha:1, time:1, transition:"linear"});
}
//----handles the Click event added to the photoLoader----
function onClickBack(event:MouseEvent):void {
Tweener.addTween(thumbsHolder, {x:0, time:1, transition:"easeIn"});
Tweener.addTween(loaderHolder, {x:1000, time:1, transition:"easeOut"});
Tweener.addTween(thumbsHolder, {alpha:1, time:1, transition:"linear"});
Tweener.addTween(loaderHolder, {alpha:0, time:1, transition:"linear"});
}
This was actually a tutorial that I modified for my own needs, and I noticed the author chose to use UILoader. I tried putting my preloader code into the photoloader section with the UILoader but got no results. I've seen some sites do this before such as http://www.aeiko.net/. Any help is really appreciated.
Alex
Creating A Flash Image Gallery With Thumbnails
I have half created an image gallery by creating a movie clip in which I have stored each image under in a different frame. I used this AS on arrow buttons to select backwards and forwards:
on (press) {
if (box_mc._currentframe == 1) {
box_mc.gotoAndStop(box_mc._totalframes);
} else {
box_mc.prevFrame ();
}
}
and
on (press) {
if (box_mc._currentframe == box_mc._totalframes) {
box_mc.gotoAndStop(1);
} else {
box_mc.nextFrame ();
}
}
I have thumbnails on the page. How would I get them to also link to the corresponding image in the movie clip?
Also the thumbnails are of a set number on the page. How could I get them to slide a new set in when I move the mouse near to the last one either way?
Image Gallery With Thumbnails Usng Flash & XML
I have a problem with the image gallery with thumbnails from http://www.kirupa.com/developer/mx2004/thumbnails.htm. The problem is, that can't make the link fuction work. I mean - on your website you can click the big image and there is a link. I downloaded thubnail_final.fla file and in the image XML file there are links connected with every image like this:
<pic>
<image>http://www.kirupa.com/developer/mx2004/pg/medialab.jpg</image>
<caption>Media Lab</caption>
<thumbnail>http://www.kirupa.com/developer/mx2004/pg/medialab_sm.jpg</thumbnail>
<link>http://www.media.mit.edu/</link>
</pic>
Sorry for so stupid problem but I'm a begginer - could somebody help me with this?
Trouble With Flash Image Gallery And Thumbnails
I originally tried to make this photopage work in flash6, but I just upgraded to 8 and I still cannot get it working. The normal photo window and buttons work fine, but the thumbnails fail to show up at all. I have gone through Kirupa's awesome tutorials to get to this point, but I just cannot get my head around why the thumbnails are just completely failing for me. Would someone mind grabbing my .fla and trying to find what mistake I have made. I am completely at a loss ;;. Thanks.
http://www.levelforge.planetquake.ga...dailyphoto.zip
Making Multiple Page Changer For Image Thumbnails?
I'm making the Flash component of a build-online postcard tool, and can't make it so it will display multiple pages of thumbnails to select from.
As it is right now, it displays all the images on one page.
http://kolorview.kinetics1.com and select either "Greeting Cards" or "Sell Sheets" and "Build Online" to get to the Flash tool.
marshdabeachy gave me a good clue on how to make multiple pages, but so far I haven't been able to make it work.
All I get is the one image I have "hardcoded" to display (and the onCLick on it doesn't work,) and none of the other images show up.
Here's what I have for the code:
code:
// select a blank image for uploaded images
//////////////////////////////////////////////////////////
_global.blankimg = "images/creator/sellsheets/blankimg.jpg";
this.createEmptyMovieClip("mc", 111);
//mc._x = 186.2;
//mc._y = 5.0;
this.mc.createEmptyMovieClip("imgHolder_mc1", 111);
this.mc.imgHolder_mc1.loadMovie(blankimg, "hihi");
this.mc.imgHolder_mc1._x = 195;
this.mc.imgHolder_mc1._y = 60;
this.mc.imgHolder_mc1._xscale = this.mc.imgHolder_mc1._yscale=40;
//this.mc.swapDepths(_root.img_logo_front);
//this.mc.imgHolder_mc1._visible = 0;
//
////////////////////////////////////////////////////////////
// load the thumbnails
////////////////////////////////////////////////////////////
depth = 0;
myVars = new LoadVars();
myVars.load("sellsheets.txt");
/////////////////////////////////////////////////
// BEGIN IMAGE DISPLAY
/////////////////////////////////////////////////
//THE FOLLOWING IS THE MULTI-PAGE ATTEMPT
//
pages = Math.ceil(images/8);
var page = 1;
function applyImages(page) {
_root.createEmptyMovieClip("allPics", 0);
var x = 1;
var y = 1;
var cols = 4;
var xSpacing = 125;
var ySpacing = 170;
for (var i=(page-1)*8; i<(page-1)*8+8; i++) {
var xPos = x*xSpacing;
var yPos = y*ySpacing;
newPic(xPos, yPos, this["image"+i]);
if (x == cols) {
y++;
x = 1;
} else {
x++;
}
}
};
/*
//
//THE FOLLOWING WORKS TO DISPLAY ALL THE IMAGES AT ONCE
//
myVars.onLoad = function(success) {
if (success) {
var i = 0;
var x = 1;
var y = 1;
var cols = 4;
var xSpacing = 125;
var ySpacing = 170;
while (this["image"+i] != undefined) {
var xPos = x*xSpacing;
var yPos = y*ySpacing;
newPic(xPos, yPos, this["image"+i]);
if (x == cols) {
y++;
x = 1;
} else {
x++;
}
i++;
}
}
};
*/
/////////////////////////////////////////////////
// END IMAGE DISPLAY
/////////////////////////////////////////////////
_root.createEmptyMovieClip("allPics", depth);
function newPic(x, y, image) {
var holder = _root.allPics.createEmptyMovieClip("imageHolder"+d epth, depth);
holder._x = x +70;
holder._y = y - 110;
holder._xscale = holder._yscale=40;
holder.onPress = function() {
_root.allPics._visible = false;
_root.gotoAndStop("crdFront");
_global.mainimage = image;
};
holder.createEmptyMovieClip("pic", 1);
holder.pic.loadMovie(image);
trace("width = " + holder._width + " height = " + holder._height);
//holder._xscale = (485 / holder._width) * 100;
//holder._yscale = (388 / holder._height) * 100;
++depth;
}
(The line "var page = 1;" I stuck in there just to get the function to work. When I get it to work, then I'll create buttons or whatever to change the pages.
Any ideas on how to make the multiple page function work?
THANKS!!
Making Multiple Page Changer For Image Thumbnails?
I'm making the Flash component of a build-online postcard tool, and can't make it so it will display multiple pages of thumbnails to select from.
As it is right now, it displays all the images on one page.
http://kolorview.kinetics1.com and select either "Greeting Cards" or "Sell Sheets" and "Build Online" to get to the Flash tool.
marshdabeachy gave me a good clue on how to make multiple pages, but so far I haven't been able to make it work.
All I get is the one image I have "hardcoded" to display (and the onCLick on it doesn't work,) and none of the other images show up.
Here's what I have for the code:
code:
// select a blank image for uploaded images
//////////////////////////////////////////////////////////
_global.blankimg = "images/creator/sellsheets/blankimg.jpg";
this.createEmptyMovieClip("mc", 111);
//mc._x = 186.2;
//mc._y = 5.0;
this.mc.createEmptyMovieClip("imgHolder_mc1", 111);
this.mc.imgHolder_mc1.loadMovie(blankimg, "hihi");
this.mc.imgHolder_mc1._x = 195;
this.mc.imgHolder_mc1._y = 60;
this.mc.imgHolder_mc1._xscale = this.mc.imgHolder_mc1._yscale=40;
//this.mc.swapDepths(_root.img_logo_front);
//this.mc.imgHolder_mc1._visible = 0;
//
////////////////////////////////////////////////////////////
// load the thumbnails
////////////////////////////////////////////////////////////
depth = 0;
myVars = new LoadVars();
myVars.load("sellsheets.txt");
/////////////////////////////////////////////////
// BEGIN IMAGE DISPLAY
/////////////////////////////////////////////////
//THE FOLLOWING IS THE MULTI-PAGE ATTEMPT
//
pages = Math.ceil(images/8);
var page = 1;
function applyImages(page) {
_root.createEmptyMovieClip("allPics", 0);
var x = 1;
var y = 1;
var cols = 4;
var xSpacing = 125;
var ySpacing = 170;
for (var i=(page-1)*8; i<(page-1)*8+8; i++) {
var xPos = x*xSpacing;
var yPos = y*ySpacing;
newPic(xPos, yPos, this["image"+i]);
if (x == cols) {
y++;
x = 1;
} else {
x++;
}
}
};
/*
//
//THE FOLLOWING WORKS TO DISPLAY ALL THE IMAGES AT ONCE
//
myVars.onLoad = function(success) {
if (success) {
var i = 0;
var x = 1;
var y = 1;
var cols = 4;
var xSpacing = 125;
var ySpacing = 170;
while (this["image"+i] != undefined) {
var xPos = x*xSpacing;
var yPos = y*ySpacing;
newPic(xPos, yPos, this["image"+i]);
if (x == cols) {
y++;
x = 1;
} else {
x++;
}
i++;
}
}
};
*/
/////////////////////////////////////////////////
// END IMAGE DISPLAY
/////////////////////////////////////////////////
_root.createEmptyMovieClip("allPics", depth);
function newPic(x, y, image) {
var holder = _root.allPics.createEmptyMovieClip("imageHolder"+d epth, depth);
holder._x = x +70;
holder._y = y - 110;
holder._xscale = holder._yscale=40;
holder.onPress = function() {
_root.allPics._visible = false;
_root.gotoAndStop("crdFront");
_global.mainimage = image;
};
holder.createEmptyMovieClip("pic", 1);
holder.pic.loadMovie(image);
trace("width = " + holder._width + " height = " + holder._height);
//holder._xscale = (485 / holder._width) * 100;
//holder._yscale = (388 / holder._height) * 100;
++depth;
}
(The line "var page = 1;" I stuck in there just to get the function to work. When I get it to work, then I'll create buttons or whatever to change the pages.
Any ideas on how to make the multiple page function work?
THANKS!!
Making Multiple Page Changer For Image Thumbnails?
I'm making the Flash component of a build-online postcard tool, and can't make it so it will display multiple pages of thumbnails to select from.
As it is right now, it displays all the images on one page.
http://kolorview.kinetics1.com and select either "Greeting Cards" or "Sell Sheets" and "Build Online" to get to the Flash tool.
marshdabeachy gave me a good clue on how to make multiple pages, but so far I haven't been able to make it work.
All I get is the one image I have "hardcoded" to display (and the onCLick on it doesn't work,) and none of the other images show up.
Here's what I have for the code:
code:
// select a blank image for uploaded images
//////////////////////////////////////////////////////////
_global.blankimg = "images/creator/sellsheets/blankimg.jpg";
this.createEmptyMovieClip("mc", 111);
//mc._x = 186.2;
//mc._y = 5.0;
this.mc.createEmptyMovieClip("imgHolder_mc1", 111);
this.mc.imgHolder_mc1.loadMovie(blankimg, "hihi");
this.mc.imgHolder_mc1._x = 195;
this.mc.imgHolder_mc1._y = 60;
this.mc.imgHolder_mc1._xscale = this.mc.imgHolder_mc1._yscale=40;
//this.mc.swapDepths(_root.img_logo_front);
//this.mc.imgHolder_mc1._visible = 0;
//
////////////////////////////////////////////////////////////
// load the thumbnails
////////////////////////////////////////////////////////////
depth = 0;
myVars = new LoadVars();
myVars.load("sellsheets.txt");
/////////////////////////////////////////////////
// BEGIN IMAGE DISPLAY
/////////////////////////////////////////////////
//THE FOLLOWING IS THE MULTI-PAGE ATTEMPT
//
pages = Math.ceil(images/8);
var page = 1;
function applyImages(page) {
_root.createEmptyMovieClip("allPics", 0);
var x = 1;
var y = 1;
var cols = 4;
var xSpacing = 125;
var ySpacing = 170;
for (var i=(page-1)*8; i<(page-1)*8+8; i++) {
var xPos = x*xSpacing;
var yPos = y*ySpacing;
newPic(xPos, yPos, this["image"+i]);
if (x == cols) {
y++;
x = 1;
} else {
x++;
}
}
};
/*
//
//THE FOLLOWING WORKS TO DISPLAY ALL THE IMAGES AT ONCE
//
myVars.onLoad = function(success) {
if (success) {
var i = 0;
var x = 1;
var y = 1;
var cols = 4;
var xSpacing = 125;
var ySpacing = 170;
while (this["image"+i] != undefined) {
var xPos = x*xSpacing;
var yPos = y*ySpacing;
newPic(xPos, yPos, this["image"+i]);
if (x == cols) {
y++;
x = 1;
} else {
x++;
}
i++;
}
}
};
*/
/////////////////////////////////////////////////
// END IMAGE DISPLAY
/////////////////////////////////////////////////
_root.createEmptyMovieClip("allPics", depth);
function newPic(x, y, image) {
var holder = _root.allPics.createEmptyMovieClip("imageHolder"+d epth, depth);
holder._x = x +70;
holder._y = y - 110;
holder._xscale = holder._yscale=40;
holder.onPress = function() {
_root.allPics._visible = false;
_root.gotoAndStop("crdFront");
_global.mainimage = image;
};
holder.createEmptyMovieClip("pic", 1);
holder.pic.loadMovie(image);
trace("width = " + holder._width + " height = " + holder._height);
//holder._xscale = (485 / holder._width) * 100;
//holder._yscale = (388 / holder._height) * 100;
++depth;
}
(The line "var page = 1;" I stuck in there just to get the function to work. When I get it to work, then I'll create buttons or whatever to change the pages.
Any ideas on how to make the multiple page function work?
THANKS!!
Howto: Create Thumbnails Which Control Pop Up Image And Text?
Hello,
I am designing a site for a client who wants a portfolio section which contains a series of thumbnails on the left which the user can roll over. Each thumbnail calls up a larger version of the image and text about the image to a blank area on the right. Has anyone seen a tutorial on how to do this, a component which can handle it, or a flash file which I can look at to figure it out?
I am hoping to do it in a way in which the entire section is self contained within one flash file, and doesn't reference other HTML pages.
Thanks,
Cosmos
|