Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Small Bug In Kirupa Gallery Tutorial


small bug in the kirupa gallery tutorial.
when you click several times on the next button very fast, the counter isn't counting. and the wrong picture is shown. but when you click on the back button fast it works correctly.

anyone who can solve this.
or give me a hint to solve it because i can't find the solution.

you can find the tut here: http://www.kirupa.com/developer/mx20...togallery9.htm

thanks.
max.




KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 12-23-2006, 01:23 PM


View Complete Forum Thread with Replies

Sponsored Links:

Xml Gallery From Kirupa Tutorial
hi all. i've used the tutorial here for the photo gallery with scrolling thumbnail. everything works fine except the thumnails are aaaaaalllll the way to the right. they don't come up where they're supposed to. I'm looking at it and it's not even showing the thumbnails on the site... I don't know what's wrong. They show up on the swf file way to the right but they don't show at all on the site. Can someone tell me what do I need to do to get the thumbnails in place?

Below is the link to the site I'm working on click on "photo gallery"

http://www.africandancelady.com

stop();


function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("pics.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);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[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._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._heig ht)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += 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._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+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(thumbnails[k], "thumbnail_mc.t"+k);
}

View Replies !    View Related
Kirupa Photo Gallery Tutorial
I used this tutorial (http://www.kirupa.com/developer/mx/photogallery.htm)and everything worked great but i also wanted to other images to load in a different loadbox at the same time. (Using the same button) Not being in expert in action script, i duplicated the code, changed all the variable names accordingly but i had a problem. The 2 scripts don't seem to work together. One loads the images properly and the other doen't. If i take 1 off, the other works and vice-versa. I am sure i changed all the variable names but they still conflict somehow.

Any ideas.

Code:

this.pathToPics = "images/";

this.pArray = ["journeys0.jpg", "journeys1.jpg", "journeys2.jpg"];
this.fadeSpeed = 10;
this.pIndex = 0;

loadMovie(this.pathToPics+this.pArray[0], _root.loadbox);
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.loadbox._alpha>this.fadeSpeed) {
this.loadbox._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.loadbox;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.loadbox.getBytesLoaded();
t = this.loadbox.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.loadbox._alpha<100-this.fadeSpeed) {
this.loadbox._alpha += this.fadeSpeed;
} else {
this.loadbox._alpha = 100;
this.onEnterFrame = null;
}
};


//------------------The other loadingbox-------------------

this.pathToPics = "images/";
// fill this array with your pics
this.nArray = ["1of3.swf", "2of3.swf", "3of3.swf"];
this.fadeSpeed2 = 10;
this.nIndex = 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.nArray[0], _root.numbox);
MovieClip.prototype.changeNum = function(d2) {
// make sure pIndex falls within pArray.length
this.nIndex = (this.nIndex+d2)%this.nArray.length;
if (this.nIndex<0) {
this.nIndex += this.nArray.length;
}
this.onEnterFrame = fadeOut2;
};
MovieClip.prototype.fadeOut2 = function() {
if (this.numbox._alpha>this.fadeSpeed2) {
this.numbox._alpha -= this.fadeSpeed2;
} else {
this.loadNum();
}
};
MovieClip.prototype.loadNum = function() {
// specify the movieclip to load images into
var num = _root.numbox;
//------------------------------------------
num._alpha = 0;
num.loadMovie(this.pathToPics+this.nArray[this.nIndex]);
this.onEnterFrame = loadMeter2;
};
MovieClip.prototype.loadMeter2 = function() {
var i2, l2, t2;
l2 = this.numbox.getBytesLoaded();
t2 = this.numbox.getBytesTotal();
if (t2>0 && t2 == l2) {
this.onEnterFrame = fadeIn2;
} else {
trace(l2/t2);
}
};
MovieClip.prototype.fadeIn2 = function() {
if (this.numbox._alpha<100-this.fadeSpeed2) {
this.numbox._alpha += this.fadeSpeed2;
} else {
this.numbox._alpha = 100;
this.onEnterFrame = null;
}
};

View Replies !    View Related
Kirupa Photo Gallery Tutorial
Hi.

http://www.kirupa.com/developer/mx20...otogallery.htm

How can I add a option, that If smb click on the showing image, it will trigger, lets say getURL("current_showing_image.jpg", "_new"); and show the image.

Thx.

View Replies !    View Related
Two Questions On Kirupa's XML Gallery Tutorial
Hi,

1) How do I make all images preload in one load instead of individual ones?

2) How do I make prev/next buttons disappear on first/last image respectively? Or failing that, how to make images loop?

thanks,

M

View Replies !    View Related
XML Gallery - Modified From Kirupa's Tutorial
so i basically just wanted to rip off MX file to create a cool gallery for my site.
I used this tutorial's MX file to start
http://www.kirupa.com/developer/mx20..._slideshow.htm

But i tried to resize the "whiteBox" instance, so that i could use larger pictures.
But there's somthing going on in the tutorial file that i dont understand, it seems to be magnifying all the imagesto about 200% (ish)

Im not sure how to change this, if its in the actionscript, or in the "quality" setting on the image?

Any help would be very much apreciated!
thanks
--Matt--

my FLA file can be downloaded at www.mattwhelan.com/SiteForShow.fla and the xml www.mattwhelan.com/images.xml

View Replies !    View Related
Kirupa Xml Photo Gallery Tutorial Help
kirupa's xml photo gallery tutorial worked like a charm, except it lacked solutions to place different photos with different orientations, i used to solve this problem by adding a background in photo shop to unify their dimensions. Now I have to place them on to a transparent flash background, so i can no longer photoshop my photos with a solid color bgd, and as far as i know, flash won't support tif or psd, or any layered formats.

I wonder if someone out there could tell me what to do refencing the kirupa xml photo gallery tutorial?

big thanks.

View Replies !    View Related
About Kirupa's XML Gallery With Thumbnail Tutorial
Hi,

I want to put a background image to all thumbnails. So when the thumbnail is loaded it will have a beatiful frame.

Can somone guide me? How can I achieve this?

http://www.kirupa.com/developer/mx2004/thumbnails.htm

To make it more clear:

Currently the thumbnails are like this



But I want to load that picture into a movieclip which have a background picture inside so at the end I will achieve this



And here is the code:


Code:

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
en = [];
boy = [];
yukseklik = [];
seri = []
model = []
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
en[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
boy[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
yukseklik[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
seri [i] = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue;
model [i] = xmlNode.childNodes[i].childNodes[8].firstChild.nodeValue;
thumbnails_fn(i);
}
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);
desc_txt.text = description[p];
en_txt.text = en[p];
boy_txt.text = boy[p];
yukseklik_txt.text = yukseklik[p];
serimodel_txt.text = seri[p] + " " + model[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
en_txt.text = en[p];
boy_txt.text = boy[p];
yukseklik_txt.text = yukseklik[p];
serimodel_txt.text = seri[p] + " " + model[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
en_txt.text = en[0];
boy_txt.text = boy[0];
yukseklik_txt.text = yukseklik[0];
serimodel_txt.text = seri[0] + " " + model[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 ((this._ymouse>=thumbnail_mc._y) && (this<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((this._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((this._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += 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._x = hit_left._x+(target_mc._width+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(thumbnails[k], "thumbnail_mc.t"+k);
}
Thanks a lot if someone can help.

View Replies !    View Related
Kirupa Gallery Tutorial Question
For those who made or have followed this tutorial:
http://www.kirupa.com/developer/mx2004/thumbnails.htm

I have a question:

I made the gallery fine, but when i load the whole gallery into my website (dynamically) using loadMovie, the hit_left and hit_right don't seem to work. I have tried to load it into several sites, but hit_left and hit_right just don't work after a loadMovie. They work fine as a standalone html, but not with loadMovie.
Anyone had this problem? I know its a long shot, but hopefully someone has done this tutorial
Thanks a lot! I have been striving with this for a while....
Cheers,
David

View Replies !    View Related
Help With XML/Flash Gallery - Kirupa Tutorial
I've been working through this tutorial here: http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm

Its a nifty little gallery and i'm going to utilise it but i have hit a little stump regarding displaying the images. The images in this tutorial all appear to be 300 x 200. I'm wanting to display (for example) 5 images all of different size. Thing is, if i go into the XML file and change the locations of the images to bigger than that of 300 x 200 then it only displays a fraction of the image i have changed it too.

How can i make it so that the images (varying in widths and height) will all display as their original sizes?

I can paste some AS code if you need to have a look.

P.S - if i adjust the size of the MC that displays the images this seems to display the fraction of the larger image, but at a zoomed in size.

Thanks all.

View Replies !    View Related
Kirupa's Photo Gallery Tutorial... For AS3?
Hello,

I came across Kirupa's Photo Gallery tut at http://www.kirupa.com/developer/mx20...otogallery.htm. It's been extremely helpful and is brilliantly written! I was wondering if there was an updated version for AS3? I've looked through the tutorials and couldn't find anything of the sort.

Thanks!

Jesse

View Replies !    View Related
Kirupa Photo Gallery Tutorial
I used this tutorial (http://www.kirupa.com/developer/mx/photogallery.htm)and everything worked great but i also wanted to other images to load in a different loadbox at the same time. (Using the same button) Not being in expert in action script, i duplicated the code, changed all the variable names accordingly but i had a problem. The 2 scripts don't seem to work together. One loads the images properly and the other doen't. If i take 1 off, the other works and vice-versa. I am sure i changed all the variable names but they still conflict somehow.

Any ideas.

Code:

this.pathToPics = "images/";

this.pArray = ["journeys0.jpg", "journeys1.jpg", "journeys2.jpg"];
this.fadeSpeed = 10;
this.pIndex = 0;

loadMovie(this.pathToPics+this.pArray[0], _root.loadbox);
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.loadbox._alpha>this.fadeSpeed) {
this.loadbox._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.loadbox;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.loadbox.getBytesLoaded();
t = this.loadbox.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.loadbox._alpha<100-this.fadeSpeed) {
this.loadbox._alpha += this.fadeSpeed;
} else {
this.loadbox._alpha = 100;
this.onEnterFrame = null;
}
};


//------------------The other loadingbox-------------------

this.pathToPics = "images/";
// fill this array with your pics
this.nArray = ["1of3.swf", "2of3.swf", "3of3.swf"];
this.fadeSpeed2 = 10;
this.nIndex = 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.nArray[0], _root.numbox);
MovieClip.prototype.changeNum = function(d2) {
// make sure pIndex falls within pArray.length
this.nIndex = (this.nIndex+d2)%this.nArray.length;
if (this.nIndex<0) {
this.nIndex += this.nArray.length;
}
this.onEnterFrame = fadeOut2;
};
MovieClip.prototype.fadeOut2 = function() {
if (this.numbox._alpha>this.fadeSpeed2) {
this.numbox._alpha -= this.fadeSpeed2;
} else {
this.loadNum();
}
};
MovieClip.prototype.loadNum = function() {
// specify the movieclip to load images into
var num = _root.numbox;
//------------------------------------------
num._alpha = 0;
num.loadMovie(this.pathToPics+this.nArray[this.nIndex]);
this.onEnterFrame = loadMeter2;
};
MovieClip.prototype.loadMeter2 = function() {
var i2, l2, t2;
l2 = this.numbox.getBytesLoaded();
t2 = this.numbox.getBytesTotal();
if (t2>0 && t2 == l2) {
this.onEnterFrame = fadeIn2;
} else {
trace(l2/t2);
}
};
MovieClip.prototype.fadeIn2 = function() {
if (this.numbox._alpha<100-this.fadeSpeed2) {
this.numbox._alpha += this.fadeSpeed2;
} else {
this.numbox._alpha = 100;
this.onEnterFrame = null;
}
};

View Replies !    View Related
Kirupa Photo Gallery Tutorial
Hi.

http://www.kirupa.com/developer/mx20...otogallery.htm

How can I add a option, that If smb click on the showing image, it will trigger, lets say getURL("current_showing_image.jpg", "_new"); and show the image.

Thx.

View Replies !    View Related
Photo Gallery Using XML And Flash Tutorial By Kirupa
ok this is the deal.. i did the tutorial on here of the photo gallery using xml with thumbnails, and i can't get my pictures to be centered. Im in desperate need of some help.. to see what i mean check out this link http://www.priscillamarie.com/private/photos.html

the FLA is too big so if you think you can help i will email it too you....



Kurve

View Replies !    View Related
Image Transition In Kirupa Gallery Tutorial
I worked through the Kirupa Gallery with Thumbnails tutorial. I am a novice, but quick learner. I would like to change the gallery so that when I click on a thumbnail, the large pictures also scroll into place--like this gallery: http://www.digicrafts.com.hk/components/fc_galerie.php

I imagine I have to change both the script that displays the large images, and the the thumbnail portion.

Thanks!

View Replies !    View Related
Xml Photo Gallery Loop (using Kirupa Tutorial)
Hi,
I have photo galleries loading via an xml file.
Right now, it stops at the last photo. I would like it to "loop" back to the first photo instead of stopping and vice versa for the previous button.
Here is my code for next and previous buttons.
Thanks!

function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 20;
picture.contentPath = image[p];
picture_num();
if(!auto_dsbl){
slideshow();
}
}
}
}

function prevImage() {
if (p>0) {
p--;
picture._alpha = 20;
picture.contentPath = image[p];
picture_num();
}
}

View Replies !    View Related
Problem With Xml Gallery Based On Kirupa Tutorial
Hi
I want to change code from here http://www.kirupa.com/developer/mx20...togallery2.htm that at the end of photos next_btn will change colour for black, or just set alpha=0. Also With prev_btn at the first photo.

Anyone can help?
thank You
Rafal

View Replies !    View Related
Problems With Tutorial "Photo Gallery Using XML And Flash" On Kirupa.com
Hallo!

I was looking for a tutorial exactly like this one on Kirupa.com:

http://www.kirupa.com/developer/mx20...otogallery.htm


My problem is that the images can't be loaded.
Flash says that there was a problem opening the URL.

If I change the file-names in the XML-File, the problem appears again.

Maybe another hint:
When I use "Publish Preview", Firefox says that an unsafe action was stopped. Unfortunately I don't know how to fix this.

I use Flash CS3.

Thanks for your help!

View Replies !    View Related
Kirupa Tutorial "photo Gallery Using XML And Flash"...align Image Center?
Hi, I have a question about the tutorial for creating a gallery that lets you import images using xml over at Kirupa. TBy default the images load aligned left which isn't all that good for different sized images, I was wondering if there is a way to align the images center when they load? I have to admit my knowledge of flash and actionscript is minimal at best.

I've been searching through the Kirupa forums and have only found one post of use, (couldn't find anything here) and the post contains this...


Quote:





Originally Posted by txfrog1999


you need to determine the width of the image being loaded (I usually add this information to my XML file along with the height of the image) and then use AS to move the mc loading the image along the _x axis to center within the container:


ActionScript Code:
if (img_w[p]<250) {
    x_pos = ((250-img_w[p])/2)+10;
    picture._x = x_pos;
} else {
    picture._x = 10;
}





however I have no idea where in the tutorial AS to put this code and not 100% sure where to put the image dimentions in the xml (I'm just new to xml), would a guess at <image width="356">...</image> be right for a 356px image?


Any help would be greatly appreciated.
Thanks.

View Replies !    View Related
Help With Kirupa.com XML Flash Photo Gallery Kirupa.com Example
Hello,

I'm trying to figure out how to highlight the text as the image is visible.

So image 1 fades in Text Highlights > Image 2 fades in Image 1 text fades out to gray and image 2 text fades in to blue...and so on.

It would also be nice so if I click on the description text the associated image to the text would appear again. : )

Here is a link to the working flash files :

http://www.opticinteractive.com/deve..._pg_final.html

Thanks

Brian


ActionScript Code is Below :



delay = 3000;
//-----------------------
function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

}
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();

}

};
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);
desc_txt.text = description[p];
picture_num();
slideshow();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}
function slideshow() {

myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {

clearInterval(myInterval);
if (p == (total-1)) {

p = 0;
firstImage();

} else {

nextImage();

}

}

}

View Replies !    View Related
Kirupa Tutorial ?
I followed the full website tutorial found it great _ But the only thing I didn't get was how did you inbedded the text in the buttons
EX when you presed the membership button __ the text --a membership is open to everyone pops up_ how was this done ??

On my page I assigned an action to the button(about)_ on (release) {
gotoAndStop("about");
}
Heres the thing i assigned the same script for a news button too

But when i test the movie you can press the about button and get info _ but the news button doesn't work
But if you refresh and click the news button first it works fine but the about button doesn't work -- what to do

another quick ?
On my site i have a porfolio button _ the page shall contian small tumbnails _ when clicked they inlarge _ Can I do all this in the same layer as my main frame or do I have to build it in a new layer or movie clip ????

Thanks for your time and help

View Replies !    View Related
Tutorial In Kirupa
hello m8s.. i wonder if i can do this tutorial in another way?

http://www.kirupa.com/developer/acti...entication.htm
the tutorial is about login and password trough flash. But to be a member, the tutorial maker have made a .php file to write in username etc... I wonder if it couldnt be done in flash??


Please Post !

View Replies !    View Related
Kirupa Tutorial Help
I'm having a hard time getting this tutorial to work for me. I'm new to the whole "component" feature in Flash and I need some help or clarification.
Here's the link to the tutorial I'm trying to complete:

http://www.kirupa.com/developer/mx/newsflasher.htm

Please help me if you can!

View Replies !    View Related
XML Tutorial On Www.kirupa.com
there's a great 40+ page tutorial here

http://www.kirupa.com/web/xml/index.htm

I would like a printable version of this. Is there any way I could get the document so I can print it and not have to go to every page and print. thanks

View Replies !    View Related
About Kirupa Tutorial
i built my website accroding to the tutorial "creating a full flash site" in Kirupa tutorial section.
the main page is empty and has an empty target MC.

whenever i click on any of the navigation buttons, an external SWF is called and loaded in the target MC.

how can i make the empty main page load immediately the "about" page ?? i dont want it to be empty. i want the first empty page to calls the "about.swf".

i have attached screnshots of the main, about and pictures pages.

anyone can help ???

View Replies !    View Related
Kirupa Tutorial Help Plz
hi im building my first flash site and am trying to make my buttons make my text appear on the screen in a certian area, and im doing the "creating a full flash site" tutorial to learn it.

my problem is i dont understand..... i no when you publish you get your .swf file but how do you make the information you want to appear, a .swf file,

plz help a zamma

View Replies !    View Related
Kirupa Tutorial
I've been playing with the flash and XML slide show (http://kirupa.com/developer/mx2004/xml_slideshow.htm) tutorial from this site. I have changed it a bit so it uses the loader component to load swfs instead of jpgs into a movie clip. I have my component set to scale the content of the swfs when they are loaded so they completely fit in the 647X80 I am loading them into the loader but its not rescaling them, Any ideas?

Thanks in advance


ActionScript Code:
delay = 60000;//----------------------- 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("images.xml");///////////////////////////////////// p = 0;this.onEnterFrame = function() { filesize = picture.getBytesTotal(); loaded = picture.getBytesLoaded(); 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);   picture_num();   slideshow();  } }}function firstImage() { if (loaded == filesize) {  picture._alpha = 0;  picture.loadMovie(image[2], 1);  picture_num();  slideshow(); }}function slideshow() { myInterval = setInterval(pause_slideshow, delay); function pause_slideshow() {  clearInterval(myInterval);  if (p == (total-1)) {   p = 0;   firstImage();  } else {   nextImage();  } }}

View Replies !    View Related
Kirupa Tutorial Help
Hey all,

I'm new to flash and found the Kirupa website that I like the desgin of
I'm doing the tutorial 'Creating a Simple Flash 8 Animation' and on page 3 it tells me to change the text to 'alpha'. I've looked everywhere and I can't where I change it. Can anyone help me?

Thanks,

DarkArrow

View Replies !    View Related
Help With A Kirupa Tutorial
I want to alter some code within this tutorial from kirupa:
http://www.kirupa.com/developer/acti...dom_motion.htm

I'll only have one movieclip flying around the stage, but I need to restrict it from entering a certain area.

My stage is 600x450 and in the middle of the stage I want to put a text area that is approx 450x250 and I'll populate this with text from xml doc. But basically I don't want my flying object to go into the text area... so it either bounces off of or swerves away from it when it gets near it.

I'll probably make the boundaries larger than the stage so my object flys out of view every now and then.

Here is the code from the above tutorial:


Code:
onClipEvent (load) {
//data you may want to change
width = 700;
height = 550;
speed = Math.round(Math.random()*2)+1;
//initial positions
x = Math.random()*width;
y = Math.random()*height;
this._x = x;
this._y = y;
x_new = Math.random()*width;
y_new = Math.random()*height;
}
onClipEvent (enterFrame) {
//x movement
if (x_new>this._x) {
sign_x = 1;
} else {
sign_x = -1;
}
dx = Math.abs(x_new-this._x);
if ((dx>speed) || (dx<-speed)) {
this._x += sign_x*speed;
} else {
x_new = Math.random()*width;
}
//y movement
if (y_new>this._y) {
sign_y = 1;
} else {
sign_y = -1;
}
dy = Math.abs(y_new-this._y);
if ((dy>speed) || (dy<-speed)) {
this._y += sign_y*speed;
} else {
y_new = Math.random()*height;
}
}
I'd really appreciate any help with this.
Thanks
Mark

View Replies !    View Related
Kirupa Pop Up Tutorial?
hi, i am trying to use this tutorial

http://www.kirupa.com/developer/mx/centered_popup.htm

to produce a pop-up window showing a movie called noticeboard.swf
I have managed to achieve this in a test movie by changing one line of code (the target URL) which you can see if you click on the right hand button at this link

www.piscesswimschool.net/cpopup.html

The problem is when i try to use the same button with the same actions applied to it in my actual website...it does nothing at all!!you can see this by going to the "about us" page at
www.piscesswimschool.net/layout1.html

The only difference i can think of is that it is contained in a longer movie and i may not have pasted the actions that appear in frame 1 of the tutorial into the correct frame in the main website. Where should these actions go?? Or is the problem something else??

please help me, im going out of my mind.

View Replies !    View Related
Can Anyone Add To This Kirupa Tutorial?
The tutorial here is great but does anyone know how to make this work but only when you're mouse is within a certain distance of the that MC?

View Replies !    View Related
Kirupa Tutorial ?
I followed the full website tutorial found it great _ But the only thing I didn't get was how did you inbedded the text in the buttons
EX when you presed the membership button __ the text --a membership is open to everyone pops up_ how was this done ??

On my page I assigned an action to the button(about)_ on (release) {
gotoAndStop("about");
}
Heres the thing i assigned the same script for a news button too

But when i test the movie you can press the about button and get info _ but the news button doesn't work
But if you refresh and click the news button first it works fine but the about button doesn't work -- what to do

another quick ?
On my site i have a porfolio button _ the page shall contian small tumbnails _ when clicked they inlarge _ Can I do all this in the same layer as my main frame or do I have to build it in a new layer or movie clip ????

Thanks for your time and help

View Replies !    View Related
Tutorial In Kirupa
hello m8s.. i wonder if i can do this tutorial in another way?

http://www.kirupa.com/developer/acti...entication.htm
the tutorial is about login and password trough flash. But to be a member, the tutorial maker have made a .php file to write in username etc... I wonder if it couldnt be done in flash??


Please Post !

View Replies !    View Related
Kirupa Tutorial Help
I'm having a hard time getting this tutorial to work for me. I'm new to the whole "component" feature in Flash and I need some help or clarification.
Here's the link to the tutorial I'm trying to complete:

http://www.kirupa.com/developer/mx/newsflasher.htm

Please help me if you can!

View Replies !    View Related
XML Tutorial On Www.kirupa.com
there's a great 40+ page tutorial here

http://www.kirupa.com/web/xml/index.htm

I would like a printable version of this. Is there any way I could get the document so I can print it and not have to go to every page and print. thanks

View Replies !    View Related
Kirupa Tutorial Help Plz
hi im building my first flash site and am trying to make my buttons make my text appear on the screen in a certian area, and im doing the "creating a full flash site" tutorial to learn it.

my problem is i dont understand..... i no when you publish you get your .swf file but how do you make the information you want to appear, a .swf file,

plz help a zamma

View Replies !    View Related
Modifying A Kirupa Tutorial
Hi,

Can someone please modify this tutorial (http://www.kirupa.com/developer/mx2004/transitions.htm) so that it does this:
one of the external swf's has a button in it that loads another external swf in a different area of the stage, so now there would be 2 external swf's displayed on stage. Then, when one of the main buttons is clicked, the exit animation of the 2nd swf is played, then the exit animation of the 1st swf is played, then the new external swf is loaded in the same spot that the 1st one was.

Thanks!

View Replies !    View Related
Help Needed On Kirupa Tutorial Re: XML
on the following Link http://www.kirupa.com/developer/flas...ml_as3_pg6.htm
in the section "Filtering Attribute Information"

Kirupa takes you through filtering by the ISBN number, these results include the XML tags as well could anybody advise me how i would eliminate them in this section:

function ParseBooks(bookInput:XML):void {
trace("XML Output");
trace("------------------------");

var authorList:XMLList = bookInput.Book.(@ISBN == "0743203178");
trace(authorList);
}

i beleive its using the .text(); function but i can't find where to put it.

also, in order to load this information into a dynamic text box do i just replace trace with the destination of my text box?

Thanks
Daniel Hodkinson

View Replies !    View Related
Request A Kirupa Tutorial?
How do I contact Kirupa?

I would like to request that kirupa adds a tutorial to his tutorial list. Its a buttons one and is a very nice effect. It can be seen at:

http://www.stellamccartney.com

It's the way the light yellow movieclip glides across the buttons from end to end and the way the text appears underneath.

If you know how I can do a request, please respond.

Thank you.

View Replies !    View Related
Kirupa Tutorial Problem?
I have been following claudio's tutorial on creationin a transition and preloader.

However for some reason my movie will not play the "opening" sequence so that the swf file behind the transition is visible.

I've included the file so hopefully someone could help me, please.

One think I have noticed is that the function command looks for "_root.section" and I don;t know if this is action script or if it is looking for a label?

thanks

View Replies !    View Related
Question About Tutorial In Kirupa.com
I am going through the tutorial in Flash MX under Basic in Kirupa.com. I came across "Creating Drop-down menu" and I am tried to download the unfinished field to working on, but after I finished download it and open it, it give me a message in Flash program "Unexpected Format". I did save it as "ddm.fla". Please help me. Thank you very much.

View Replies !    View Related
Kirupa Snow 2.0 Tutorial
How can I make the snow go rising and not falling, like bubbles ? (inverted)

This is the tut btw: http://www.kirupa.com/developer/mx2004/snow.htm

View Replies !    View Related
About Kirupa's XML In Flash Tutorial
URL: http://www.kirupa.com/web/xml/examples/portfolio.htm

Does anyone have a clue how I can edit the portfolio, so that I use text instead of thumbnails to list all my entries.

And, another thing. How can I get all entries (text) to be displayed in vertical direction?

Best Regards
Eirik Fjellaksel

View Replies !    View Related
Problem With Kirupa Tutorial
Hello

I am trying to make this kirupa tutorial work but am not having any luck

http://www.kirupa.com/developer/mx/photogallery.htm

I don't understand why it isn't working (when I run the script I don't see anything. just a blank screen, no pictures are loading. I am not getting an error path when opening the pics so I know that the path is correct)

the only line I changed was this one

Code:
from
this.pArray = ["image0.jpg", "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg", "image6.jpg", "image7.jpg", "image8.jpg", "image9.jpg"];

to

this.pArray = ["fruit0.jpg", "fruit1.jpg", "fruit2.jpg", "fruit3.jpg", "fruit4.jpg"];
the pictures in the animation folder are now named fruit0.jpg", "fruit1.jpg", "fruit2.jpg", "fruit3.jpg", "fruit4.jpg

what am I missing?

if I run the script as it is in the zip file(before I make the changes) all works fine.

I am puzzled...
Can anyone help me out?

thank you

bsw

View Replies !    View Related
Kirupa Tutorial Problem
I'm having trouble with the Loading random movies tutorial on Kirupa. Everything worked fine, however when the external movie was loaded, the animation was blown up by about 500%. How can I fix this problem?

View Replies !    View Related
Kirupa Authentication Tutorial Help
hey everyone,
I followed the kirupa authentication tutorial to the T and everything works great, except for the checklog function. my movie will not go to frame 2 or 3 yet the status window says you're in! Any ideas why this is??
Thanks in advance!

View Replies !    View Related
Snow > Kirupa Tutorial
The Flash MX 2004 Tutorial on Snow..

How do I invert the gravity so the snow goes Up?

likewise how do I slow the speed down on it.

thanks so much..

The movie parims are 648x486

View Replies !    View Related
Kirupa's Thumbnail Tutorial
Hey All,

I just got done with Kirupa's thumbnail gallery found here http://www.kirupa.com/developer/mx2004/thumbnails.htm and I havent figured out how to set up the xml or flash AS for making the thumbnails "clickable". He doesnt go into detail on how to do this in the tutorial although his tutorial clearly shows it. If anyone knows what needs to be done, please contact me or post here in this thread. Thanks,

Jonathan

View Replies !    View Related
Modifying A Kirupa Tutorial
Hi,

Can someone please modify this tutorial (http://www.kirupa.com/developer/mx2004/transitions.htm) so that it does this:
one of the external swf's has a button in it that loads another external swf in a different area of the stage, so now there would be 2 external swf's displayed on stage. Then, when one of the main buttons is clicked, the exit animation of the 2nd swf is played, then the exit animation of the 1st swf is played, then the new external swf is loaded in the same spot that the 1st one was.

Thanks!

View Replies !    View Related
Kirupa Scrollbar Tutorial
Hi there guys...

Im having a bit of a problem with the Flash MX scrollbar skinning tutorial from Phil Barker on the homepage: http://www.kirupa.com/developer/mx/s..._scrollbar.htm

Ive pretty much followed it step by step but some parts are really ambiguous, so i was wondering if anyone could give it a go and send me the .fla for me to work from, or if you have it lying around anywhere just send it to me (please lol)

Cheers...

View Replies !    View Related
Kirupa Tutorial Php5
http://www.kirupa.com/developer/flas...ets_flash8.htm

i'm trying to do this, but i got problems in setting the apacher and php5.0.
i think the problems is i my pc pre-installed iis from microsoft, which i have other set of localhost directory in the "Inetpub" folder.

anybody having the same problems as me?
please give me some guidelines..
thanks..

View Replies !    View Related
Kirupa's PHP Socket Tutorial
Link to the recent tutorial

Will this tutorial work on servers like this? I read through the tutorial and the author links to his own socket server. Do we have to pay big bucks for our own socket server or can a regular cheap host's server be converted to one?

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved