Freaking Weird Image Gallery Problem
Hey guys:
I don't know where to begin with words, so I'll just start out with a picture:
01.gif shows my layout for my 3-image gallery. Flash loads a complete list of photos from a php file (which works) and 3 images at a time would be selected, resized, and placed into one of the image boxes. All of the pictures do in fact load like they should, but the problem is the resizing.
02.gif shows what goes wrong. The first and last images remain their original (huge) size. For some reason, only the 2nd picture is resized properly when all 3 image boxes are enabled, and the first picture is resized properly when the third image box is enabled (if that makes sense).
It sounds like a timing issue, but i honestly am clueless. Any suggestions would be greatly appreciated!
-Matt
---source
Code:
//--- define the current gallery page
pageNum = 1;
//--- use PHP to load and calculate total number of pages
totalPages = Math.ceil(totalPics / 3);
back_btn.enabled = false;
forward_btn.onRelease = function () {
pageNum = pageNum+1;
container1.loadPic(0 + ((pageNum-1) * 3));
container2.loadPic(1 + ((pageNum-1) * 3));
container3.loadPic(2 + ((pageNum-1) * 3));
back_btn.enabled = true;
if (pageNum == totalPages) {
forward_btn.enabled = false;
}
}
back_btn.onRelease = function () {
pageNum = pageNum-1;
container1.loadPic(0 + ((pageNum-1) * 3));
container2.loadPic(1 + ((pageNum-1) * 3));
container3.loadPic(2 + ((pageNum-1) * 3));
forward_btn.enabled = true;
if (pageNum == 1) {
back_btn.enabled = false;
}
}
//--- load totalPics from PHP file
countMe = new LoadVars ()
countMe.load("loadpics.php?dummy="+Math.random())
countMe.onLoad = function (true) {
if (true) { totalPics = this.cnt; }
}
//--- load pic locations from XML file
var pArray = new Array();
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes[i].attributes.src);
}
container1.loadPic(0 + ((pageNum-1) * 3));
container2.loadPic(1 + ((pageNum-1) * 3));
container3.loadPic(2 + ((pageNum-1) * 3));
}
}
gallery_xml.load("photos.xml");
//--- load pic into Flash
MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var num = pic - (3 * (pageNum - 1));
var frame = this["container"+num];
var t = frame.getBytesTotal();
var l = frame.getBytesLoaded();
per = Math.round((l/t) * 100);
if (l == t && frame._width>0 && frame._height>0) {
while (frame._width>150 || frame._height>150) {
frame._width = frame._width * 0.9;
frame._height = frame._height * 0.9;
} delete this.onEnterframe;
}
};
};
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 07-21-2005, 12:31 PM
View Complete Forum Thread with Replies
Sponsored Links:
Thumbnails Loads Weird [image Gallery Tut + Thumbs]
Hallo there,
I am having troubles with the thumbnails on my page.. they`re loading weird.
there are double thumbnails, odd spaces, overlapping thumbs ect. I`ve double checked my xml and code but can`t find why this happens.
You can see what I mean with 'odd' --here-- by clicking the portfolio link..
Can someone help me out why this is happening? I have used the luvley tutorials [image gallery and the xtra thumnails tut] to make this
Here is the code I use:
Code:
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;
thumbnails_fn(i);
periode[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
titel[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
techniek[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
afmeting[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
tekst[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
trace("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);
prev_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
btn_0010.onRelease = function() {
btn0010();
};
btn_9000.onRelease = function() {
btn9000();
};
btn_8090.onRelease = function() {
btn8090();
};
btn_7080.onRelease = function() {
btn7080();
};
////////////////////////////////////////////////
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;
// 75, 80 : Left top corner
// 356 : Possible max width
// 252 : Possible max height
picture._x = 73+Math.floor((356-picture._width)/2);
picture._y = 80+Math.floor((252-picture._height)/2);
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
///////////////////////////////////////////////////
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(("images/")+image[p], 1);
titel.text = titel[p];
fotoTitel.text = titel[p];
techniek.text = techniek[p];
periode.text = periode[p];
afmeting.text = afmeting[p];
tekst.text = tekst[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(("images/")+image[p], 1);
titel.text = titel[p];
fotoTitel.text = titel[p];
techniek.text = techniek[p];
periode.text = periode[p];
afmeting.text = afmeting[p];
tekst.text = tekst[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(("images/")+image[0], 1);
titel.text = titel[0];
fotoTitel.text = titel[p];
techniek.text = techniek[p];
periode.text = periode[p];
afmeting.text = afmeting[p];
tekst.text = tekst[p];
picture_num();
}
}
function btn0010() {
p = 18;
picture._alpha = 0;
picture.loadMovie(("images/")+image[18], 1);
titel.text = titel[18];
fotoTitel.text = titel[18];
techniek.text = techniek[18];
periode.text = periode[18];
afmeting.text = afmeting[18];
tekst.text = tekst[18];
picture_num();
}
function btn9000() {
p = 12;
picture._alpha = 0;
picture.loadMovie(("images/")+image[12], 1);
titel.text = titel[12];
fotoTitel.text = titel[12];
techniek.text = techniek[12];
periode.text = periode[12];
afmeting.text = afmeting[12];
tekst.text = tekst[12];
picture_num();
}
function btn8090() {
p = 6;
picture._alpha = 0;
picture.loadMovie(("images/")+image[6], 1);
titel.text = titel[6];
fotoTitel.text = titel[6];
techniek.text = techniek[6];
periode.text = periode[6];
afmeting.text = afmeting[6];
tekst.text = tekst[6];
picture_num();
}
function btn7080() {
p = 0;
picture._alpha = 0;
picture.loadMovie(("images/")+image[0], 1);
titel.text = titel[0];
fotoTitel.text = titel[0];
techniek.text = techniek[0];
periode.text = periode[0];
afmeting.text = afmeting[0];
tekst.text = tekst[0];
picture_num();
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+"/"+total;
}
////////////////////////////////////////////
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._xmouse>=thumbnail_mc._x) && (_root._xmouse<=thumbnail_mc._x+thumbnail_mc._height)) {
if ((_root._ymouse>=(hit_bottom._y-40)) && (thumbnail_mc.hitTest(hit_bottom))) {
thumbnail_mc._y -= scroll_speed;
} else if ((_root._ymouse<=40) && (thumbnail_mc.hitTest(hit_top))) {
thumbnail_mc._y += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._y = hit_top._y+(target_mc._height+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(("thumbs/")+thumbnails[k], "thumbnail_mc.t"+k);
}
here is a part of the xml I use:
Code:
<root>
<image>
<pad>1_7080.jpg
<thumbnail>t1_7080.jpg
<periode>1970 - 1980
<titel>zonder titel
<techniek>ets
<afmeting>22x34
<tekst>Ut nunc turpis, bibendum.....</tekst>
</image>
....
</root>
The thumbnails have a max of 73 px height or width [portait, landscape or square]
Can someone help me why the thumbs are loading this way?
Many thanks in advance !
-xoa-
View Replies !
View Related
Random Background Image Freaking Out?
Hi,
I have a movie clip with 9 frames. Each frame has a different image. Then I have AS to generate a random number and go to that number frame when the project is loaded (the whole thing is an exe on a CD by the way but the problem occurs whether I'm running it off my hard drive or the CD). It works great MOST of the time. The problem is that once in awhile when you load the project the random generator code seems to be ignored and all the images flash by, looping over and over. You have to close the project and relaunch to get it to stop.
Is there some way to fix this problem? This CD will be going to potential clients.
Thanks!
TS
View Replies !
View Related
[F8] Help With Weird Problem On Gallery Page
Hi all gurus!
i have created a gallery page http://www.verticalsuits.com/gallery.html
it was working fine until I have added a second frame to the thumbnails, and now, its really weird because when I press on the second set of thumbnails, nothing works, and when I go back to the first set, they dont work anymore. (but the first set works fine BEFORE i go to the second and come back)
I cant attach the file as it is way to big (2mb) but I can email it to you if you can take a look.
Also, I am trying to find a proper code to have the timeline go forward and backward depending on which thumbnail is pressed. I have found a few and did a lots of experiments, but nothing really works.... any ideas?
Thanks a LOT!!
:-)
View Replies !
View Related
Pls Look At My Weird Problem For My Gallery Application
ok... u guys need to dl my files so that u noe what i am saying...
download here
the weird problem is....for the first image it loads(where i intentionally initialised)... the border doesn't correspond to the image... i did a trace and it came out 77 for the width and 52 for the height which is not what the first .jpg file dimension is.... weird thing is where did it get 77 and 52 from..?
the rest loads and works ok.. only for this one when it first loads.... anyone know y..?
View Replies !
View Related
Weird Problem Has Cropped Up With Flash/XML Gallery Tutorial
Someone please help me out here! I've been tearing my hair out!
I've been using the Flash/XML gallery for a few months now without any problems.
Recently, I went to add some new galleries to our newsletter but the new galleries only display the odd # pictures, ie. 1, 3, 5, 7, etc. They never display the even numbered ones. The linked xml file does display the correct caption for the image, but no image is visible
I've attached a zip file with the fla, swf and xml included.
You can see here how the gallery is supposed to work.
I'm wondering if there is something wrong with my version of Flash MX when it generates the swf file.
Can someone please offer me some advice??!
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
Weird Image Pop Up
http://www.comfortupholstery.com
go to the gallery page... then hit exit at the bottom. Do you see the images pop up? I can't even find those images on the server let alone find the as path. Any of the cuff ideas? My files are to big to zip. If Anyone thinks they might know what it is I'll take off the index page for a while so you can download the pages from the server.
Please any help is life or death important right now!
Thank you.
View Replies !
View Related
Weird Image Distortion
Hi
I am trying to create a scrolling menu bar thing, that is going to have thumbnail images that when clicked they pop up into a bigger version. I am able to make it all, but have 60 photos that need to go on it, so the bar is really mong and I have just created one long image that I have brought into flash and made it so that it scrolls across by createting simple tweens that move it left to right and then the buttons are gotos and plays every few frames in the movie. When I publish the movie out I find that the bar, with the long image on it is all wack. It is all streaked as if it is moving really fast, when it is not even moving at all. I am not really sure what the problem is and why it is going all streaked. As everything is right. well so I think I have checked everything. Are there problems with the publishing out of these images when they are so big.
Sorry about being so long winded, just thought if you could help that you would need to know everything.
Hey thanks in advance.
Cheers
Mark
View Replies !
View Related
Weird Image Deally
Hi Guys,
Im doing a lil' pet project, and getting a wierd display.
I have created the images in photoshop with 'Scanlines'
They look fine as standalone images etc..
When i import to flash it appears as the images have a gap in the middle...
see for yourself
http://matt.icecave.com.au/future/demo.html
any ideas / suggestions?
cheers
Vamps
View Replies !
View Related
Weird Image Problem
Hello everyone
I've been working on this site navigation, and I've encountered a really weird image problem. I made all the animation in movieclips, so I had only one frame. When I view my animations, everything looks fine and my balloon looks like this:
That's how it's supposed to look. Now, I went and make another frame in front of this one with a loading movieclip. When I view my animation now, here's what I get:
The balloon looks all pixelized! All I added was a frame in front of it. Any ideas why this is happening? Even when there is nothing in the frame before the animation frame, it still happens. Please help!
View Replies !
View Related
Weird Image Problem
so i placed an image on the stage of my flash movie, a rather large jpeg image about 1.7mb and about 4200px wide. When i place it on the stage and align it to absolute left and top, and then press ctrl Enter to view it, it shows up fine. Now, when i center the image so that the center of the image is on the movie stage and the rest hangs off the edge of the stage, and then export the movie to test it, the image turns to a color spectrum. I've tried using jpeg and gif, does the same thing at 300dpi and 70dpi. Now, the weird part, as if that isn't weird enough. When i zoom in on the exported flash movie with the spectrum, if i zoom in two times, i can see the pic zoomed in twice. Is that weird or am i missing something???
View Replies !
View Related
Movie/anim Gallery? (not Image Gallery)
Ive come across this gallery and preloader
http://www.flashkit.com/movies/Scrip...7797/index.php
I love the way I can just dump my images in a folder and with a few tweaks it will put these images in the gallery.
What I am looking at is a way to do this with seperate .swf animations.
What I want to be able to do is dump a number of linear animation swf files into a folder, then when I launch the gallery, the first animation plays, and when it reaches the end it automatically plays the next animation in the folder. Then I want the whole thing to loop.
Any ideas?
View Replies !
View Related
XML Gallery - Generate XML Path For Image Gallery
I learned from great tutorial of kirupa .
I tried to create own image gallery, now I stay in front of problem.
How can I generate path for my images and thumbnails for XML file.
E.g. I have 110 images paths and 110 thumbnails path.
Manually takes it lot of time , how can I make this code for XML file?
<pic>
<image>images/img/ref/img/img_001.jpg</image>
<thumbnail>images/img/ref/thm/img_001.jpg</thumbnail>
</pic>
next node, next node,
...
last node:
<pic>
<image>images/img/ref/img/img_110.jpg</image>
<thumbnail>images/img/ref/thm/img_110.jpg</thumbnail>
</pic>
View Replies !
View Related
Product Gallery, Image Gallery Or Portfolio..
Hi! This is probably insanely much to ask for but I do it anyway This is for us designers that want to learn some action script to help us show some xml driven data in our flash projects.
I’ve been searching the web for tutorials that can help me with a specific project that I want to develop. I’ve found a bounce of things that is close to what I’m looking for but not right on the spot. And I think that there are many out there that are looking for the same tutorial as I am. For me the best way to learn is to deconstruct example files with code hints. So if any of you flash gurus out there could help us with an example .Fla for this project I think many would be very happy!
The project:
I want to create a gallery of “what ever”. It could be a product gallery, image gallery or a portfolio. This can be used for many things. I’ve attached an image (template.jpg) that pretty much explains what I’m looking for. I also included an example of how the xml file could look like.
I think this could be an excellent example for many designers/developers that are new to dealing with xml, images and flash.
View Replies !
View Related
Fla Freaking Out WHY
Ok, here is the scoop. I got a project that I started from scratch. I got alot of it done. Its not a big project. The most complicated thing is loading a movie into a MC, and thats it. Now Every single time I close the FLA and reopen it to work some more the entire project is mixed up. I got red block replacing images, I got things where there are not soppose to be. Its like a bad joke. Every single time I have to close it, I gotta DECOMPILE my own SWF! I went to a new computer and dloaded the trial of flash, well my fla does the same thing on that computer. What is the deal...and how do I stop it!?
View Replies !
View Related
Kirupa Picture Gallery / Keeping The Image On Stage As New Image Loads
Hi, I have the Kirupa Image Gallery implemented and it works great. But I was wondering how I can go about having the image stay on screen as it is loading the next image, so it's not such an abrupt transition. Currently the image container goes blank as it loads the next image. I assume I will need another image movieclip that sits underneath the first one... but then what?
Thanks!
View Replies !
View Related
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/
View Replies !
View Related
Weird Image Scrolling Problem - Bug?
I'm creating a photo showcase where I have a series of images lined up end-to-end horizontally. To view them, you just move the mouse left or right to scroll them (kind of like a panorama).
What's happening is this:
Due to the size and number of pictures, the actual movie clip containing the pictures extends off the end of the Flash stage. When I render out the movie, all the pictures that don't fit on the stage come out as horizontal bars of color!
Here's the SWF file for this, so you can see what I mean:
http://www.wickedpenguin.com/shockwa...ry_authors.swf
View Replies !
View Related
Weird Order Of Image Appearance.
Hello People
I'm trying to create a flash website which has different movieclips as backgrounds which have transition effects and appear over each other if you click on a particular button.
So basically you start with background1 and then when you click on a button the movieclip associated with that button would then play and appear over the previous movieclip. After this the first movieclip would become invisible. I've upload the .swf and the .fla if you want to have a look. The problem comes in when you click on a button for a split second the new movie will appear over the old one and only then start playing. It's easy to see what I mean if you have a look at the swf file.
Can any of you clever people tell me what the hell is going on?
you can have a look here:
http://www.waterberg.co.za/temp/example.html
I've replaced the images with smaller ones in the fla to reduce download times.
Yours sincerely
Wouter
View Replies !
View Related
Help: Vector Image Published Weird
Howdy,
This is probaby a piece of cake for someone. I can't figure it out. Why in the hell is the "slider" (the tilted oval) of the volume slider .fla (attached file) distort when it is published?
Notice in the .fla the "slider" graphic is smooth and looks great. When I publish the movie the "slider" graphic deforms for some reason. What gives?
Thanks,
mperla
View Replies !
View Related
Weird Preloader And Image Loaded
Hi everyone..
just a quick question....why my preloader are not working as suppose to ..because when I test locally it works great...and then when I publish it to real using the actuall path..it seems the preloader not shown up and the image not show up as well..
here's are the as I'm using;
ActionScript Code:
stop();var getImagename:LoadVars = new LoadVars();getImagename.onLoad = function(){ loadtheImage(this.imgname);}getImagename.load("http://www.someactuallurl.com/getimage.php");Bar._xscale = 0;function loadtheImage(thestuff:String){ createEmptyMovieClip("container",this.getNextHighestDepth()); container.loadMovie("admin/img/"+thestuff); temp = createEmptyMovieClip("tmp", this.getNextHighestDepth()); temp.onEnterFrame = function() { var t = container.getBytesTotal(); var l = container.getBytesLoaded(); var percent = Math.round((l/t)*100); trace(percent); Bar._xscale = percent; if (l == t && t>0) { Bar._xscale = 0; delete this.onEnterFrame; } };}
Any help or shoot would be appreciated..
Thanks
View Replies !
View Related
3D Carousel Weird Image At Loading?
Hello
The 3d carousel is fantastic but i seem to have encountered an issue
when it loads it has a very odd royal blue blue box about 2 inches tall by half inch wide appear on the screen briefly. this appears in the upper left portion of the screen
any ideas what this might be? would like to make it go away! since it is all loading dynamically i have no idea where this little gremlin is coming from
thanks
justin
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
Actionscript Image Gallery > Updating Thumbnail And Main Image
Hi all,
I'm helping a friend produce a small Flash website. For some artwork/photos.
Basically a strip of thumbnail images at the bottom, clicking a thumbnail will load the (fullsize) image above.
Currently ten thumbnails scroll across.
**The problem**
.. is he wants to be able to drop a thumbnail image and the corresponding fullsize image into a folder on the server. The Movie should then display the latest additions. I can produce a simple slideshow where extra images are loaded at run-time (MX introduced this). But am trying to figure out how to update both the thumbnail strip and the main image.
Any help/pointers greatly appreciated.
Robert
View Replies !
View Related
XML Gallery: Preload On Current Image/cross-fade Image
Hello,
I am new to action script but I am learning quickly.
I took the following tutorials and made a hybrid:
Photo Gallery Using XML and Flash
Photo Slideshow Using XML and Flash
I redesigned the interface and created this:
http://www.onarresdesign.com/greg/work2.html
Everything works great, but now I want to take it further than the tutorial.
I am trying to make the images cross-fade. I am open to any suggestions and I have tried many techniques with little success.
Here is the closest solution steps I have come up with:
Code:
1) First image preloads (grey background showing)
2) First image loaded into top level MC 1
3) First image fades in
4) First image in top level MC 1 remains visible
5) First image gets loaded into bottom level MC 2 behind current movie clip.
6) Top level MC 1 clears because its preloading next image
Bottom level MC 2 remains visible
7) Preloader shows on top of bottom level MC 2
8) Next image is loaded into top level MC 1
9) Next image fades in (cross-fade effect achieved because previous image is behind it)
10) Next image gets loaded into bottom level MC 2
Repeat process
I can't get the action script to do what I want. I have off set the moveclips to show that the images are loading into both movieclips. I currently have the 'nextImage()' function controlling this so it is understandable the both images are cleared because the function is loading new images into the movie clips at the same time. How do I get one movie clip to remain constant while the other is loading? It seems to be a matter of where the function is placed. Or so I think.
I would appreciate any help I can get on this. If would also appreciate any suggestions for making the code for the control buttons cleaner.
Thank you,
</asla>
View Replies !
View Related
Freaking Out Here--what The Heck Is This?
http://www.slimpixi.com/reiner/new
i am going to freak out in about five seconds at 4am here. i have checked it out so many times: the email address:
the mailto: reinerjohn61@yahoo.com is the code i wrote
and still when i check it it comes out: reiner.john61@yahoo.com
anyone have any clue why this is?
slimpixi
View Replies !
View Related
Freaking Out About Effects
Hello!
As the thread topic stated I am freaking out.
I'm trying to achieve an effect featured on pixelranger. Let me explain.
After clicking on "enter site" the next page loads up. Under the butterfly imag a series of blocks flash in. The blocks have the following headings : "Recent Projects" "Genisis Project" "Gear" & "Mailing List"
Now take not how these blocks appear on the page, they flash white and sort of fade in. I want to do this. I have created the elements I want to "flash" in, all I need is how do I make the effect work.
Now I know it might take a while, but if anyone gets the time I need the following :
1. A step by step explanation of what to insert where (as in.."at frame 2 insert your symbol..."
2. What is the best FPS for this?
thank you for your help, hope to get a reply real soon.
Cheers
View Replies !
View Related
ClearInterval Is Freaking Me Out
What's wrong with my script, can someone tell me why it doesn't work ?
IT ISN'T CLEARING THE INTERVAL !!!!
onClipEvent (load) {
function myInterval() {
_root.play();
}
}
onClipEvent (enterFrame) {
setInterval(myInterval, 4000);
clearInterval(myInterval);
}
View Replies !
View Related
Need A Freaking ICON
Guys... I develop this amazing flash movie for an interactive cd. The client has his heart set on having that icon on the cd when he pops it in. I know how to manipulate the autorun.inf to do that (icon=stupid.ico)
But, how do I make his logo into an icon? and what are the sizes?
View Replies !
View Related
Flash XML Freaking Out - Help
Ok, a VERY weird thing started happening with a flash app I was designing.
This project I've been working on loads XML by passing name/value pairs of data to an ASP page. Based on the results, the ASP page dishes up straight XML.
Now this is working very well on the flashless test pages - XML pops right up as expected. Also, the last time I worked on this project, I had no problem loading the XML.
No I'm working on the project again, and if I view the app either locally or on my site, I get an xml status of 0 (no data loaded). Strangely enough, if I just run the SWF outside any HTML pages, I have no trouble loading the data.
What's going on here????
View Replies !
View Related
Freaking Firefox
One of my pages in messed up in firefox only. I have a couple issues actually. On this page http://childphotographyportraits.com/babiesgallery.html the swf at the top has a green background (in IE it is white). When I looked at the source code in firefox the bg color was set to the green I was using previously (I recently updated the site). But when I look at my code in my ftp it has no green anywhere, all the bg is white. Where is this green code coming from? If I cant find it to change it to white how can I fix it?
Also, I have the right click in IE disabled on this page http://www.childphotographyportraits.com/blog.html but how can I do the same thing in firefox and other browsers?
I know I can do a search for that question, but I thought I would take my chances here first.
View Replies !
View Related
Freaking Shim
I'm just a few SecurityDomain errors away from hitting myself in the face with my keyboard.
Okay, here's the deal:
Movie A (shim_test.swf) does this:
Loads movie B
Once movie B loads, it calls a function located on the _root level of movie B
Movie A is located at www.movieA.com
Movie B (shim.swf):
Has a function that sends variables to an aspx file in the same folder and returns the resulting LoadVars object.
Movie B is located at www.movieB.com
I have wide-open (*) policy files EVERYWHERE and have System.security.allowDomain("*"); on each movie. I have even specified the exact location of the policy via using System.security.loadPolicyFile("path"); on both movies.
Is this just not possible?
Thanks!!!!
View Replies !
View Related
Rollover Image Gallery With Swap Image Effect?
I'm trying to do a flash banner like the one from:
http://www.eyeblaster.com/
when you rollover the buttons that say: eyeblaster ACM v2.0, advanced analytics, etc. the nice artistic banner appears. when you are no longer over it, it still stays to that same banner until you rollover the other buttons. so it's like a swap image effect, only in flash.
how would i go about this?
View Replies !
View Related
Photo Gallery Rollover Image Image Swap
I am using the XML Photo Gallery with thumbnails, and i have managed to modify it to suit my needs for the most part. However, some of the work i want to use it to display is photo restoration and i would like to be able to rollover the image and have a different image show on rollover. Something like you see here...http://homepage.mac.com/gapodaca/digital/bikini/ only using the XML Photo Gallery.
Any ideas?
View Replies !
View Related
Text/image Scroller Is Acting Weird
Check this out:
http://www.gradlaunchusa.com/flash.html
Click "services" or "calendar" on the top navigation, then go to the page that loads up. If you click the scroll box (not the up/down arrow) it will follow your mouse around. I want it to release when the mouse button is released...any idea how to do this?
Here's a source file from one of the pages, maybe something is wrong in the script....I'm not sure what to change.
Any help is appreciated.
View Replies !
View Related
My Loaded .swf Files Are Freaking Out
Hi,
I'm a newbie with flash. And I'm trying to create a simple application for viewing my 3D work. Sort of a demo-reel type resume.
It's for CD distribution and not the web and I don't want to use HTML for the interface. So I'd like it to be a .swf file.
Problem#1:
I have a button that loads an external .swf slideshow file to a holder object.
And I have another button that unloads it.
The problem is it loads fine and seems to unload fine. But if I click these buttons a few times the gallery.swf file speeds up exponentially every time I load and unload it until the thing is animating at warp speed?!
Here's the load button code:
on (release) {
//load Movie Behavior
if(this.holder == Number(this.holder)){
loadMovieNum("gallery.swf",this.holder);
} else {
this.holder.loadMovie("gallery.swf");
}
//End Behavior
}
Here's the unload button code:
on (release) {
//unload Movie Behavior
if(this.holder == Number(this.holder)){
unloadMovieNum(this.holder);
} else {
this.holder.unloadMovie();
}
//End Behavior
}
Problem#2:
I have a small .swf game I want to load and unload with buttons the same way as above. But when I do that the game loads fine. But many of the functions don't work correctly.
The shoot button doesn't work, things using my tell target code don't work, etc.
In short. Loading these external .swf files with loadMovie makes them freak out.
Why is this not working properly?
All of the books I read say this should work. But it doesn't.
View Replies !
View Related
Freaking Load Variables
so maybe someone can see what i cant. I have 2 php files, pass.php and setVoted.php setVoted.php echos &ToF=2
and pass.php echos &ToF2=3. When i run this script it traces only up to loaded, why wont it go any farther? (it does load the pass.php variables into dynamic text boxes, but im using the same loading method that works for setVoted so it should work for pass, but it doest.
Attach Code
&ToF = 1
&ToF2 = 1
go_btn.onRelease = function() {
trace("you clicked");
form.uname = form.uname.text;
form.loadVariables("http://www.4tenproductions.com/gary/setVoted.php", "POST");
thisInterval = setInterval(keepCheck, 1);
function keepCheck() {
if (form.ToF != 2) {
trace("not loaded yet");
form.loadVariables("http://www.4tenproductions.com/gary/setVoted.php", "POST");
} else {
trace("loaded");
clearInterval(thisInterval);
form.uname = form.uname.text;
form.loadVariables("http://www.4tenproductions.com/gary/pass.php", "POST");
waitbar.gotoAndPlay(2);
thisInterval2 = setInterval(keepcheck2, 1);
function keepcheck2() {
if (form.ToF2 != 3) {
trace("not equal");
form.uname = form.uname.text;
form.loadVariables("http://www.4tenproductions.com/gary/pass.php", "POST");
} else {
trace("equal");
clearInterval(thisInterval2);
if (form.pword.text == form.pass) {
trace("pass word is good");
if (form.voted == "yes") {
trace("you have voted");
_root.gotoAndStop(5);
} else {
trace("you have not voted");
userNum = form.unum;
_root.gotoAndStop(3);
}
} else {
trace("wrong password");
form.error.text = "WRONG";
}
//ends interval inner
}
//ends else statement
}
// ends if
}
// ends else
}
//ends function
};
//ends button function
View Replies !
View Related
Random Background Pic Freaking Out
Howdy all,
I have a flash exe on a CD. Every time the project loads it has a new background image. The AS for this works fine. However, every once in a while when the project is loaded the backgound becomes all the images flashing. I have 9 different images in 9 frames of a movie clip (called "theClip") and the AS is:
ActionScript Code:
choice = Math.floor(Math.random()*13); // returns an integer between 0 and 12theClip.gotoAndStop(choice);
So obviously there are times when the AS is being ignored and it's just playing all the frames of the clip. Unfortunately this CD is being given out to potential clients so I really need to find out if there is a way to prevent this from happenning.
Any ideas?
View Replies !
View Related
Freaking 1195 Error Over And Over Again
I am a super novice at ActionScript and have been going over a bunch of tutes. Currently I am deployed so I plan on spending all my free time becoming a master at Flash, but first things first.
Here is the error:
1195: Attempted access of inaccessible method stageWidth through a reference with static type flash.display:Stage.
Here is the code from a book I am studying:
package {
import flash.display.MovieClip;
import Mover;
import flash.events.Event;
public class Bouncer extends Mover {
public function Bouncer(targetMC:MovieClip, xVel:Number, yVel:Number) {
super(targetMC,xVel,yVel);
}
private function bounceAtBorder():void {
if (this.targetMC.x > this.targetMC.stage.stageWidth(this.targetMC.width/2)) {
trace("Bounce at right edge");
this.targetMC.x = this.targetMC.stage.stageWidth(this.targetMC.width/2);
this.xVel *= -1;
}
if (this.targetMC.y > this.targetMC.stage.stageHeight(this.targetMC.heig ht/2)) {
trace("Bounce at bottom edge");
this.targetMC.y = this.targetMC.stage.stageHeight(this.targetMC.heig ht/2);
this.yVel *= -1;
}
if (this.targetMC.x < this.targetMC.width/2) {
trace("Bounce at left edge");
this.targetMC.x = this.targetMC.width/2;
this.xVel *= -1;
}
if (this.targetMC.y < this.targetMC.height/2) {
trace("Bounce at top edge");
this.targetMC.y = this.targetMC.height/2;
this.yVel *= -1;
}
}
override protected function updatePosition(evtObj:Event):void {
super.updatePosition(evtObj);
this.bounceAtBorder();
}
}
}
View Replies !
View Related
Random Background Pic Freaking Out
Howdy all,
I have a flash exe on a CD. Every time the project loads it has a new background image. The AS for this works fine. However, every once in a while when the project is loaded the backgound becomes all the images flashing. I have 9 different images in 9 frames of a movie clip (called "theClip") and the AS is:
ActionScript Code:
choice = Math.floor(Math.random()*13); // returns an integer between 0 and 12theClip.gotoAndStop(choice);
So obviously there are times when the AS is being ignored and it's just playing all the frames of the clip. Unfortunately this CD is being given out to potential clients so I really need to find out if there is a way to prevent this from happenning.
Any ideas?
View Replies !
View Related
Tween Class: Please Bounce, But No Freaking Out
Hello friends,
I am using the Tween class' Bounce.easeOut method to bring something on to and off the stage like so (based on a button's rollover/rollout):
Code:
function speakersBoing(which) {
if (which == "over") {
trace("Speakers Mouse Over");
speakersUp = null;
var speakersDown:Object = new Tween(_root.speakers, "_y", Bounce.easeOut, _root.speakers._y, 0, 2, true);
} else if (which == "out") {
trace("Speakers Mouse Out");
speakersDown = null;
var speakersUp:Object = new Tween(_root.speakers, "_y", Bounce.easeOut, _root.speakers._y, -600, 1, true);
}
}
It bounces in and bounces out just fine, unless I roll out too quickly. When I rollover and start the Bounce tween and rollout right away, it'll come in and leave nicely, but then at the end of the Bounce out, it'll pop up onto the stage at the final Y coordinate of the Bounce in...
Does that make sense? Does anything in the code jump out as a poke in the eye with a sharp stick?
Thanks in advance!
lrhb
View Replies !
View Related
[loadMovie] UnLOADED The Freaking Whole Thing?
I have a array which is the movie I want to unLoad when I click a menu, but it unloads everything on my stage...here's my code..please take a look
ActionScript Code:
workList = ["web.swf","flash.swf","drawing.swf","cd_rom.swf"];
for(k=0; k<= workList.length;k++){
mainMovie.menu1.onRelease = mainMovie.menu3.onRelease = mainMovie.menu4.onRelease = mainMovie.menu5.onRelease = function(){
_root.unloadMovie(workList[k]);
}
}
it should only unloads the stuff within workList, but it unloads eveything in my movie...and it becomes 0kb..ha....please help..what's wrong with this code??
View Replies !
View Related
Freaking Easy Flash Menu
Okay so if you look at http://www.gregoriojewelry.com/ you will see that when you put your mouse over a menu item a bar slides out, and when you navigate away, the bar recedes back. HOW THE FRICK do you get it to recede back? I can do it so it slides out using Over (in a button) but theres no Out....closest is Up, which gets played when you first start the movie...I'm so confused about this! I know it has something to do with using movie clips on the button states, but I'm not sure.....help is appreciated!!
-Tyler
View Replies !
View Related
XML Image Gallery: Replacing Xml To Load New Image Set?
Hi Kirupa crew!
First, big thanks for this great site!
Second, I'm struggling a bit on xml and hoping for a hand. Your xml image gallery is a sweet piece of work, and I would like to be able to add the functionality of being able to load different galleries from a menu without loading a new mc with gallery inside it. I managed to botch the file up pretty good on my own, and was wondering if there is a ready answer nearby.
So I'm thinking have but1, but2 and but3, with a seperate xml file for each. What would you recommend for a smooth way to swap the the xml files to the gallery, and load the first image of the new xml file? Also, can it be done with one big ol' xml file while keeping the galleries seperate? It's not necessary, but could be handy, and save some loading.
It would also be interesting to apply the same principle to the resizing script that Scotty has in that big Resizing thread, just a thought.
Many many thanks!
John
View Replies !
View Related
Gallery Image Loading - Getting Image Width..help
Ladies and gents:
having a problem with my code somewhere; I'm stumped. Here's what i'm trying to do:
-When you click on a thumbnail in my gallery a load bar appears that is the width of the loading image
-While the image loads the load bar scales from full width to zero
-Once it finishes loading the image fades in
-Click on a new thumbnail, and the old image fades out, then the scrollbar is supposed to take the width of the NEW image and do the same thing
What is happening is that the scrollbar width does not set itself to the new image size until i click the thumbnail a second time...try this link to see what i mean. it's on the "portfolio" page.
http://www.lewisweb.ws/staging
here's the code:
Code:
//CONSTANTS
frame_x = 387; //the exact x coordinate where the box originates
frame_y = 184; //the exact y coordinate where the box originates
alphaSpeed = 5; //spped at which the pics fade in
//INITIAL SETTINGS
containerMC._alpha = 0;
containerMC._x = frame_x;
containerMC._y = frame_y;
//Fades in a picture loaded externally
MovieClip.prototype.loadPic = function(pic){
containerMC.fadeOldPic(); //fade out old picture
containerMC._alpha = 0;
this.loadMovie(pic); //load new pic
var loadIsComplete = false; //reset load checker
var w = containerMC._width;
loadBar._width = w; //set loadbar to new movieclip width
loadBar._alpha = 100; //make loadbar opaque
_root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
loadIsComplete = (Math.round(l/t) == 1); //check to see if load completed
loadBar._width = w - ((l/t) * w); //sets width of loadbar dynamically
if (loadIsComplete){
containerMC._alpha += alphaSpeed; //if load is complete, fade pic in
}
//if the load is complete and the picture is fully faded in...
if (t != 0 && loadIsComplete && _root.containerMC._alpha == 100){
loadBar._alpha = 0; //make the load bar disappear
delete _root.onEnterFrame;
}
}
};
//Fades out an old picture...pretty self explanatory
MovieClip.prototype.fadeOldPic = function(){
_root.onEnterFrame = function(){
_root.containerMC._alpha -= alphaSpeed;
if (_root.containerMC._alpha == 0){
delete _root.onEnterFrame;
}
}
};
containerMC.loadPic("portfolio/westin.jpg");
stop();
ANY help will be appreciated!
View Replies !
View Related
Kirupa XML Image Gallery - Skip To Image
So I'm having some trouble modifying this script. I have a text box so a user can go to a certain image (In my case page). So if the user type 5 it should go to image 5.
I've tried numerous methods, none of which are working (they work but then my next and previous buttons aren't working properly). I know I need to just get go to the number image in the array but the way the script is set up it seems I would have to change the current position value but that doesn't seem to be the case.
Am I over complicating this?
ActionScript Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml/config.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++;
picture._alpha = 0;
picture.loadMovie("images/"+image[current_pos]+".jpg", 1);
picture_num();
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie("images/"+image[p]+".jpg", 1);
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie("images/"+image[0]+".jpg", 1);
picture_num();
}
}
function picture_num() {
current_pos = p+1;
_root.currPageNum.text = "Page " + current_pos;
}
_root.goButton.onPress = function(){
// load the image typed into the text area.
}
View Replies !
View Related
|