Fade In/Out Slideshow Images
*sigh*
Okay Here's the thing...I know this has been asked in many different ways, but as much as I searched and cut and pasted, I can't seem to get an answer or get my code to work. I currently have an xml slideshow and I would like to have my images transistion with a nice fade in and out technique. What is the exact code and where do I put it? Any help would be appreciated.
Here's my AS code...
Code:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("images.xml");
slides_xml.ignoreWhite = true;
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = currentSlideNode=rootNode.firstChild;
updateSlide(firstSlideNode);
}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
x = newSlideNode.attributes.xCoor;
y = newSlideNode.attributes.yCoor;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePath, targetClip);
targetClip._x = x;
targetClip._y = y;
}
//
// Event handler for 'Next slide' button
next_btn.onRelease = function() {
if (currentSlideNode.nextSibling == null) {
nextSlideNode = rootNode.firstChild;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
} else {
nextSlideNode = currentSlideNode.nextSibling;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
//
// Event handler for 'Previous slide' button
back_btn.onRelease = function() {
if (currentSlideNode.previousSibling == null) {
previousSlideNode = rootNode.lastChild;
updateSlide(previousSlideNode);
currentSlideNode = previousSlideNode;
} else {
previousSlideNode = currentSlideNode.previousSibling;
updateSlide(previousSlideNode);
currentSlideNode = previousSlideNode;
}
};
/// Right-Click Function
function doSomething() {}
MENU = new ContextMenu();
MENU.hideBuiltInItems();
Functioned = new ContextMenuItem("This movie is copyrighted by Your Company Name", doSomething);
MENU.customItems.push(Functioned);
_root.menu = MENU;
Many Thnx!
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-16-2006, 09:22 PM
View Complete Forum Thread with Replies
Sponsored Links:
Image Slideshow With Fade And Text Effect Over Images
Hi All,
I am beginner to flash. And i m facing a big problem. Can anybody help me.
I want a flash movie with image slideshow with fade effect. When image enter then some text should appear on it and when image change text should also change.
Actually i need flash like.
www.gtllimited.com
Please help me.
Thanks in advance...
View Replies !
View Related
Photo Slideshow - Fade Out/fade In (alpha) - Flash5
Hi all & merry Christmas
For a Photographers portfolio I want to create a fade-out/in effect for when people select one of the photos. All the photos are stored within one SWF.
So OnRelease the selected photo loads and a Var is set. The current photo is being set graduately to alpha 0% and the loaded new photo (which is a MC) is moved to the highest level while this one is being set immediately to alpha 100%.
If I think about it, what I need to code is...
- a var in which the current image is set
- a function which checks what image/mc is in the var
- a function which says something like this:
on release move new image to layer/level below current image (which is on toplevel) and set to 100% ;
set the current image (as set in var) gradually to 0% alpha
and as last move new loaded image to toplevel...
(all images would be put in an SWF which would be loaded into the main SWF)
unfortunately my AS knowledge is fairly limited, so I have no clue how to script this???
anyone an idea or possibly a tutorial which could sort me out???
thanks so much
View Replies !
View Related
Xml Slideshow Fade In And Fade Out Assistance (code Supplied)
Hi all,
Can someone help me out here - needing someone to point out (or offer!) the solution. I'm working with the following code, and want to have my slideshow images fade into each other. At the moment, the picture before, after it's reached its delay setting, just switches off and the next one fades in, meaning the background displays (which isn't desirable)
CODE BEGINS ------------------------------------------------------
delay = 4000;
//-----------------------
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();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
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();
}
function moveSlide() {
current_mc = _root.myClips_array[_root.target_mc];
new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1, true);
_root.target_mc++;
if (_root.target_mc>=_root.myImagesNo) {
_root.target_mc = 0;
}
_root.myText_txt.text = _root.myImages[target_mc].attributes.title;
next_mc = _root.myClips_array[_root.target_mc];
new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1, true);
}
}
}
CODE ENDS ------------------------------------------------------
Any help, HUGELY appreciated
Thanks in advance
View Replies !
View Related
Photo Slideshow - Fade Out/fade In (alpha) - Flash
Hi all & merry Christmas
For a Photographers portfolio I want to create a fade-out/in effect for when people select one of the photos. All the photos are stored within one SWF.
So OnRelease the selected photo loads and a Var is set. The current photo is being set graduately to alpha 0% and the loaded new photo (which is a MC) is moved to the highest level while this one is being set immediately to alpha 100%.
If I think about it, what I need to code is...
- a var in which the current image is set
- a function which checks what image/mc is in the var
- a function which says something like this:
on release move new image to layer/level below current image (which is on toplevel) and set to 100% ;
set the current image (as set in var) gradually to 0% alpha
and as last move new loaded image to toplevel...
(all images would be put in an SWF which would be loaded into the main SWF)
unfortunately my AS knowledge is fairly limited, so I have no clue how to script this???
anyone an idea or possibly a tutorial which could sort me out???
thanks so much
View Replies !
View Related
Slideshow Fade In Fade Out With Some Xml Added In
hi
i did a search in hopes that someone had answered this question. I managed to re-create a slideshow with xml following a tutorial at gotoandlearn. i'm trying to add in a fade in and fade out effect as the pictures cycle through. I tried doing it inside the movieclip itself but it doesn't seem to be working. What am I doing wrong? Can anyone point me in the right direction? Thanks
View Replies !
View Related
Images Slideshow Problem: Empty Screen Between Images
hi
i've made a script for slideshow an array of images.
I'm trying to figure out what's wrong with my script, why it has small pauses between images.
could anyone help me?
thank you.
here is the script, on the first (and only) frame of the movie:
disp_int = 150;
var index = 0;
var img_mc = new MovieClip();
var background1 = new MovieClip();
var iarray = ["test1", "test2", "test3", "test4", "test5", "test6"];
loadImg(index);
loadBackground(++index);
function loadImg(index) {
clip = iarray[index];
file = clip + ".jpg";
img_mc = this.createEmptyMovieClip(clip, 2);
img_mc.loadMovie(file);
}
function loadBackground(index) {
clip = iarray[index];
file = clip + ".jpg";
background1 = this.createEmptyMovieClip(clip, 1);
background1.loadMovie(file);
}
function fade() {
img_mc._alpha -= 10;
if (img_mc._alpha <= 0) {
img_mc._alpha = 100;
loadImg(index);
index++;
if(index==iarray.length) index=0;
loadBackground(index);
}
}
setInterval(fade, disp_int);
View Replies !
View Related
Slideshow With Fade Using AC
id like to be able to load a slide show of jpgs with a fade in and out transitions, it would be great also if you could click on the images and open them in a new window.
is there anyway of doing this with actionscript?
merci beaucoup
benji
View Replies !
View Related
AS2 - Fade Out In Used Slideshow
Hi,
I have adapted an excisting slideshow file which is xml based.
It is programmed this way so it would fade in each loaded jpg.
It would be great if somebody could help me out to make the loaded jpgs fade out as well before they are replaced by the new loaded ones.
in attachment my fla - made in flash CS 3 - use AS2.0
code used for your info:
Code:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
_root.attachMovie("back_btn", "back_btn", 5, {_x:227, _y:570});
_root.attachMovie("next_btn", "next_btn", 6, {_x:747, _y:570});
//
// Show the first slide and intialize variables
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
// Updates the current slide with new image and text
function updateSlide(newSlideNode) {
clearInterval(fader)
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
mc1.targetclip.loadMovie(imagePath);
mc1.targetclip._alpha =0
fader = setInterval (fade, 20, imagePath)
}
function fade () {
mc1.targetclip._alpha += 5
if (mc1.targetclip._alpha == 100) {clearInterval (fader)}
}
auto.onRelease = function () {
// Sl = currentSlideNode.nextSibling
updSlide = setInterval (nextSlide, 5000)
}
function nextSlide () {
SN = currentSlideNode.nextSibling;
if (SN == null) {
break;
} else {
currentIndex++;
updateSlide(SN);
currentSlideNode = SN;
}
}
// Event handler for 'Next slide' button
next_btn.onRelease = function() {
nextSlide()
};
// Event handler for 'Previous slide' button
back_btn.onRelease = function() {
previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
break;
} else {
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};
/*
//--------------------------------------------------------------------------
mc1.onEnterFrame = function () {
if (previousSlideNode == null) {
back_btn._visible = false;
}
else {
back_btn._visible = true;
}
//--------------------------------------------------------------------------
if (SN == null) {
next_btn._visible = false;
}
else {
next_btn._visible = true;
}
}
//--------------------------------------------------------------------------
*/
http://www.riverwoods.net/images/slideshow_04.fla
thanx,
View Replies !
View Related
Is It Possible To Fade-out A Slideshow?
A conceptual inquiry:
I'm planning on creating a slideshow with cross-fades.
I'll be placing this as a .swf (as a movie clip) in another .fla .
I'd like to be able to click a button in this new .fla and have the slide-show MC fade out independently of where this MC is in its timeline.
I'd also like to be able to do this on one frame (i.e., without having to add extra frames/outtros).
Since I'm basing this on a click of a button, I'm assuming I can't use an onClipEvent (enterFrame) {} as a loop for this.
Is there AS that will somewhat slowly, smoothly change the alpha on an MC or is there a way to create a loop that won't run so quickly as to "snap" the alpha from 100% to 0% faster than the eye can see?
View Replies !
View Related
Xml Slideshow Fade Out
Hello im new. Ive just completed the Kirupa XML Slideshow today and have it all working well. But i cant figure out how to fade out the previous image as the next image fades in.
Can Anyone help.
M
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");
/////////////////////////////////////
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
Slideshow Fade In And Fade Out
Hi All,
I have downloaded the photoslide show referencing the XML file, I'm want to add an effect so that when you click next or the slideshow automatically goes to the next photo, the previous photos fades out as well, while the current photo fades in. So basically fade in and then a fade out. Currently the tutorial has a fade in when you view the photo.
This has been bothering me for a while now.
Any help will be appreicated.
Thanks,
Key
Here's the code:
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 += 5;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
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
Slideshow Fade In And Fade Out
Hi All,
I have downloaded the photoslide show referencing the XML file, I'm want to add an effect so that when you click next or the slideshow automatically goes to the next photo, the previous photos fades out as well, while the current photo fades in. So basically fade in and then a fade out. Currently the tutorial has a fade in when you view the photo.
This has been bothering me for a while now.
Any help will be appreicated.
Thanks,
Key
Here's the code:
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 += 5;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
picture_num();
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
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
Random Images, Fade In, Fade Out...
Hi guys! please helpme....
I need to have 20 or so pictures from a directory fading in then out in a random order into a movie clip.
I have stumbled across this script and it is excellent, but it is not quite right,
// load random jpg/png at random, with fade this assumes you are using a
// naming convention like myfile1.jpg, myfile2.jpg, etc.
MovieClip.prototype.myloadRandomImage = function(src, format, seed) {
seed = random(seed);
loadMovie(src + seed + format, this);
_alpha = 0;
onEnterFrame = function() {
if (_alpha <= 100) {
_alpha += 10;
}
}
}
usage /
_root.createEmptyMovieClip("test",1);
_root.test.myloadRandomImage("bks/bk", ".jpg", 2);
This great script only fades in the pictures and i need them to fade out as well. Please can someone help me with the missing stuff.
I can set the property of _root.test to 0 and it goes, but not fading.
Please help
Thanks in advance.
And sorry if this has been covered but i can't find anything quite right.
View Replies !
View Related
Fade In/Fade Out Text Over Images
I am trying to create a fade in/fade out text effect over a background which consists of an image. I've tried breaking apart the text and using a shape tween with the alpha property, but it results in the text being slightly distorted.
I've also tried using a mask, but I don't want a rectangle appearing over the background.
Can anybody shed some light on how to create a text fade in/fade effect over an image without the text being distorted.
Thanks in advance.
Mitchster
View Replies !
View Related
Add Fade In / Out To MX Slideshow Template?
Could anyone help me add fade in / out between slides when using the MX slideshow template. The template works great for automatically adding my 300 .jpg's, but I need a fade feature between automated slides and a music track as well.
Any help would be greatly appreciated. And if I posted this in an inappropriate place, many apologies.
Rev. Dave Arndt
St. Johns School
View Replies !
View Related
Please Help Me Make My Slideshow Fade
I almost have this slideshow finished, it's finally working perfectly...but. I want the images to fade in and fade out when the "next, previous" buttons are pressed. Can someone help me figure this out? Below is the A.S. that I have so far:
stop();
var slideInfoLV:LoadVars = new LoadVars();
slideInfoLV.onLoad = function(success) {
if(success) {
slideCounter();
loadFrame();
} else {
frameNum.text = "Error";
}
}
slideInfoLV.load("vars/slide_info.txt");
var FrameNum = 0;
function loadFrame(){
_level0.myMCL.loadClip("images/image" + FrameNum + ".jpg", this.framesMC);
//---<this loads the text info for each image from a txt file>---\
//_level0.myLV.load("images/image" + curFrameNum + ".txt");\
}
function slideCounter(){
frameNum.text = "image " + (FrameNum + 1) + " of " + Number(slideInfoLV.totalFrames);
}
//--------------<nextSlideBtn>-----------------\
this.nextSlideBtn.onRelease = function() {
if (FrameNum < Number(slideInfoLV.totalFrames) - 1) {
FrameNum++;
} else {
FrameNum = 0;
}
loadFrame();
slideCounter();
}
//--------------</nextSlideBtn>-----------------\
//--------------<prevSlideBtn>-----------------\
this.prevSlideBtn.onRelease = function() {
if (FrameNum == 0) {
FrameNum = Number(slideInfoLV.totalFrames) - 1;
} else {
FrameNum--;
}
loadFrame();
slideCounter();
}
//--------------</prevSlideBtn>-----------------\
frameNum.autoSize = "center";
loadedInfo.autoSize = "right";
// -----------------<TextField.StyleSheet>---------------- \
/*var cssStyles:TextField.StyleSheet = new TextField.StyleSheet ();
cssStyles.load ("styles/styles.css");
cssStyles.onLoad = function (success) {
if (success) {
loadedInfo.styleSheet = cssStyles;
loadFrame();
} else {
loadedInfo.text = "There has been an error loading the requested information. Please contact the Webmaster and report your error.";
}
}
// -----------------</TextField.StyleSheet>---------------- \
*/
please ignore the lack of cleanliness in my coding, I tend to keep stuff in there just in case I need it later. Anyways, I don't want to start with fresh code so if there is any way of just inserting what I need I would be infinitely happy.
Thanks whoever
View Replies !
View Related
[F8] Simple XML Fade In/out Slideshow...HELP
Hey all, I've been googling for quite a while now and I just can't find a simple tutorial to make a xml flash slide show. I'm not looking for any advancing buttons to go to the next photo, just a little script that goes through the photos listed in an XML file. I would just like the photo to fade in from white to fade out to white and so on... Can someone help me out, Thanks!
View Replies !
View Related
[F8] Fade Out Question For A Slideshow
I was able to figure out how to control the fade in code for the images in this slideshow script but I can't figure out how to do a fade out. Any help would be very appreciated.
Thanks!
Here's the code:
delay = 5000;
//-----------------------
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
XML Slideshow-AS Fade, Needs Debugging
Okay, in this file I make a html enabled text box and make it a MC. I duplicate it, and then run a loop through my xml file (which holds jpg paths) to assign the current node value to the top MC and the next node value to the bottom MC. Then I fade the top MC and the process starts over. I have successfully tested all the things involved in this seperately, but nothing displays when I run it. I've debugged the code as much as I can, but by now I am too used to it to notice an error. If any of you can find it, I would appreciate it. In any case, feel free to use the completed file if you need an xml based slideshow, with efficient AS alpha fade transitions (with variable time between pics and time it takes to fade.)
Here is the code if you do not want to look at the file:
Code:
//START WITH EMPTY MOVIE CLIP NAMED "two"
//MC "one" is created on top of MC "two"
duplicateMovieClip ("two", "one", 1);
rootNode = new XML();
rootNode.ignoreWhite = true;
rootNode.load("home.xml");
rootNode.onLoad = function(success)
{
if (success)
{
// use firstChild to iterate through the child nodes of rootNode
_root.put1(rootNode.firstChild.nodeValue);
for (var node:XMLNode = rootNode.firstChild; node!= null; node= node.nextSibling)
{
node1=node.nodeValue;
node2=node.nextSibling.nodeValue;
if(node2!=null)
{
int1= setInterval(interval1,2000); //2 seconds
int2= setInterval(interval2,5000); //5 seconds
}
else
{
//I'll program the loop to start over here after I get it to work
}
}
}
}
//Assigns the nodeValue of the current "node" (a JPG path) to MC "one"
function put1(pic)
{
_root.one.txt.htmlText= "<img src='" + pic + "' hspace='0' vspace='0' >";
}
//Assigns the nodeValue of the current "node"'s firstChild (a JPG path) to MC "two"
function put2(pic)
{
_root.two.txt.htmlText= "<img src='" + pic + "' hspace='0' vspace='0' >";
}
//Loads the next image in the loop in MC "two", under MC "one"
function interval1()
{
put2(node2);
clearInterval(int1);
}
//Alpha fades MC "one", gives MC "one" MC "two"'s image, and deletes MC "two"'s image, returning to the state at the beginning of the loop
function interval2()
{
setInterval(fadeOutMC, fade_speed, one); //fader
_root.one.txt.htmlText=_root.two.txt.htmlText;
_root.two.txt.htmlText="";
clearInterval(int2);
}
fade_speed= 100;
//Function used to alpha fade MC "one"
function fadeOutMC(mc) {
if (getProperty(mc, _alpha)>0) {
setProperty(mc, _alpha, mc._alpha-10);
} else {
setProperty(mc, _alpha, 0);
clearInterval(fadeOutInterval);
}
}
Very respectfully,
Jerble
View Replies !
View Related
Fade Out FadeIn Slideshow
Hi all,
I'm trying to create a slide show that fades in a image waits for 2 sec then fades it out and fades in the next in the sequence and so on. I want each one to fade in and out. In the example below I'm using an array to store ref. to the images, I have two mc's, one to load one image and then the other to load the next when the first has faded out (that's the idea). The thumbs load fine and the first image loads in then out but I carnt call the function to start it again. I know this code looks a mess, can anyone revive it. or suggest another way.
Download fla here
ActionScript Code:
photo_arr = ["images/1", "images/2", "images/3", "images/4", "images/5", "images/6", "images/7", "images/8"];
for (var n = 0; n<photo_arr.length; n++) {
var photos = thumbs_mc.createEmptyMovieClip(photoHolder_mc+n, n);
photos.loadMovie(photo_arr[n]+"_th.jpg");
photos._x = 60*n;
}
numPause = 2500;
amo = 10;
var one = holder_mc.createEmptyMovieClip("loader1_mc", 2);
var two = holder_mc.createEmptyMovieClip("loader2_mc", 1);
this.createEmptyMovieClip("watcher_mc", 100);
function alphaIn() {
thisLoader.onEnterFrame = function() {
if (this._alpha<=100) {
this._alpha += amo;
if (this._alpha>=100) {
timerInterval = setInterval(alphaOut, numPause, data );
}
}
};
}
function alphaOut() {
if (this._alpha<=100) {
thisLoader.onEnterFrame = function() {
this._alpha -= amo;
if (this._alpha<=0) {
this._alpha == 0;
this.onEnterFrame = null;
clearInterval(timerInterval);
imageGen(data)
}
};
}
}
function createLoader(i, data, num) {
thisLoader = eval("holder_mc.loader"+i+"_mc");
thisLoader._alpha = 0;
thisLoader.loadMovie(data[counter]+".jpg");
watcher_mc.onEnterFrame = function() {
var picLoaded = thisLoader.getBytesLoaded();
var picBytes = thisLoader.getBytesTotal();
if (isNaN(picBytes) || picBytes<4) {
return;
}
if (picLoaded/picBytes>=1) {
alphaIn();
two.swapDepths(one);
delete this.onEnterFrame;
}
};
}
function loadImages(data, counter) {
if (i == undefined || i == 2) {
i = 2;
createLoader(i, data, counter);
i = 1;
} else if (i == 1) {
createLoader(i, data, counter);
i = 2;
}
}
function imageGen(data) {
if (counter == undefined || counter == data.length) {
counter = 0;
}
loadImages(data, counter);
counter++;
}
imageGen(photo_arr);
View Replies !
View Related
Can't Get XML Slideshow To Fade In Sync
I'm writing this script to grab data from an XML file, and fade between 2 MC of images and text. There are 2 layer each with the same instance of a clip. It loads the info into the background, once it's loaded the JPEG and 3 secs have passed it moves it to the front and fades in over the other image. Then it repeats. I can get it to work except that when I use the fadein function (which uses onEnterFrame), by the third or 4th image it keeps switching and fading out of sync. If I just use a command to give it 100% opacity instantly it works fine. But I don't know how to fade it nice... is here a problem with using 2 instances of onEnterframe? And sometimes it doesn't load the images right... is there a better way to do this?
Here's my code:
Code:
stop();
//Load XML File
my_xml = new XML();
my_xml.onLoad = myLoadHandler;
my_xml.load("http://www.siriusad.com/bott/images/test.xml");
my_xml.ignoreWhite = true;
frontImage = image1_mc;
backImage = image2_mc;
timesUp = false;
firstRun = true;
//loadhandler
function myLoadHandler(success) {
if (success == true) {
rootNode = my_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentIndex = 0;
slideshow();
} else {
trace("XML Load Error");
frontImage._alpha = 100;
frontImage.theText_mc.head_txt.text = "XML Load Error";
}
}
//function for fade in
function fadeIn() {
backImage.onEnterFrame = function() {
if (backImage._alpha<100) {
backImage._alpha += 5;
} else {
delete this.onEnterFrame;
frontImage._alpha = 0;
go_btn.onPress = function() {
getURL(clickURL);
};
slideshow();
}
};
}
//front back image function
function setFrontBack() {
if (backImage == image2_mc) {
frontImage = image2_mc;
backImage = image1_mc;
} else {
frontImage = image1_mc;
backImage = image2_mc;
}
}
function setTimesUp() {
trace("Time is up");
timesUp = true;
}
function preload() {
backImage.theImageLoader_mc.onEnterFrame = function() {
trace("timesUp: "+timesUp);
//trace(this.getBytesLoaded()+" of "+this.getBytesTotal()+"bytes loaded");
//if MC image is loaded and 3 seconds has passed
if (this.getBytesLoaded()>=this.getBytesTotal() && timesUp == true) {
delete this.onEnterFrame;
timesUp = false;
backImage.swapDepths(frontImage);
fadeIn();
//if I use these 2 instead of the fadein it works fine
//backImage._alpha = 100;
//slideshow();
}
};
}
//slideshow function
function slideshow() {
trace("- - - - - - - - - - - - - - - -");
trace("starting slideshow");
trace("currentIndex: "+currentIndex);
//set Timer
if (firstRun) {
trace("it IS the first run, ignoring interval");
firstRun = false;
setTimesUp();
} else {
trace("it's not the first run, setting interval");
setInterval(setTimesUp, 2000);
setFrontBack();
}
//set variables for this slide
headText = rootNode.childNodes[currentIndex].firstChild.nodeValue;
jpegURL = rootNode.childNodes[currentIndex].attributes.jpegURL;
clickURL = rootNode.childNodes[currentIndex].attributes.link;
//set data info back frame
backImage.theText_mc.head_txt.text = headText;
backImage.theText_mc.head_shdw_txt.text = headText;
//load image
backImage.theImageLoader_mc.loadMovie(jpegURL);
//Have to do it this to give the loader time to initilize...
setInterval(preload, 500);
if (currentIndex>=totalSlides-1) {
currentIndex = 0;
} else {
currentIndex++;
}
trace(headText+" | "+jpegURL+" | "+clickURL);
trace("- - - - - - - - - - - - - - - -");
}
Here's the FLA:
http:http://www.siriusad.com/bott/slideshow.fla (680k);
BTW, I'm using FLash MX 2004
View Replies !
View Related
How Do I Fade To Black In A Slideshow?
It's been years since I've used Flash, so I'm a bit rusty. But I am trying to use the slideshow presentation template and do transitions between the slides, but I'm not getting the results I want.
I'm putting in the preset behaviors for fade in and out, and what I get is a crossfade. What I want is a fade to black, and a fade up from black (a dip to black), and not a crossfade. Is there a simple scripting way to do this that I can put on the presentation (master) slide? If been playing with setInterval to delay the transition but I can't get it to work. Thanks.
View Replies !
View Related
Alpha Fade In And Out For My Slideshow
Hi everyone. I had to make a simple slide show for a client and they wanted it done in flash. I am not very good in flash and am having a problem trying to get the first image and text to fade in once the user clicks on the category they want.
I want both the image and the text to fade out and have a new image and new text to fade in when the user clicks the next or previous button. I would also like it if I could have the text be timed so that it will fade in AFTER the image it goes with fades in.
Right now the slide show is really ugly, I will make it pretty once I have it built and working correctly, so don't judge the look...haha.
Anyway, here is the .swf file which is what it looks like now...my .fla file was too big to upload on here. If someone can help me, I can email the .fla file to you. I would post the code, but I have so much in different places that I don't know where to start as far as what you will need. THanks so much!
I can't see the swf file that I uploaded when I click on it...hmmmm
View Replies !
View Related
Slideshow - Load & Fade
Hi all,
I'm thinking its time for a funky seemless slideshow, put I need help. What I want to accomplish is:
1. 1st image is loaded, displayed for x seconds...
2. 2nd image is preloaded behind the scenes
3. when 2nd image is fully loaded fade out 1st image and fade in 2nd image
Hopefully this will result in a seemless slideshow with no waiting... now all I have to do is start making it so if anyone can point me in the right direction any help would be greatly appreciated.
Thanks again.
View Replies !
View Related
XML Slideshow Doesn't Fade In?
Anyone else having this problem? I did Kirupa's tutorial on the XML/Flash image gallery. I traced the image paths to make sure that it's loading the right images (which it is) but for some reason they will not fade in. I can get them to appear if i change the picture._alpha to 100, but there's no point in me making it in flash if i can't get them to fade in and out. Anyone get this similar issue?
Thanks!
Travis
View Replies !
View Related
Kirupa Slideshow With Fade Out
I'm using the nice and simple (but effective) 'Photo Slideshow Using XML and Flash - http://www.kirupa.com/developer/mx20..._slideshow.htm.
I'm not so bothered about using the preloader in between images but i was wondering if someone could tell me out to make the image fade out and into the next one without any white space in between.
Any help would be greatly appreciated.
Thanks
View Replies !
View Related
Alpha Fade In And Out For My Slideshow
Hi everyone. I had to make a simple slide show for a client and they wanted it done in flash. I am not very good in flash and am having a problem trying to get the first image and text to fade in once the user clicks on the category they want.
I want both the image and the text to fade out and have a new image and new text to fade in when the user clicks the next or previous button. I would also like it if I could have the text be timed so that it will fade in AFTER the image it goes with fades in.
Right now the slide show is really ugly, I will make it pretty once I have it built and working correctly, so don't judge the look...haha.
Anyway, here is the .swf file which is what it looks like now...my .fla file was too big to upload on here. If someone can help me, I can email the .fla file to you. I would post the code, but I have so much in different places that I don't know where to start as far as what you will need. THanks so much!
I can't see the swf file that I uploaded when I click on it...hmmmm
View Replies !
View Related
Xml Slideshow With Fade&zoom- Help
Last edited by veronicas : 2008-07-28 at 06:04.
Hi there,
I have worked through a slideshow tutorial which has a fade and zoom in, as a client wanted this effect for their site:
http://www.indigolodges.com/en/winte...-lanterne.html
My problem is i need to zoom from center, not top left- i know this is possible but cant seem to find it online. Any help would be much appreciated
this is my current code
delay = 3000;
init = false;
//-----------------------
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();
zoom(picture,100,90);
} else {
content = "file not loaded!";
}
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
p = 0;
import mx.transitions.*;
import mx.transitions.easing.*;
function zoom(what,startSize, endSize) {
var ease = Strong.easeOut;
var myTween = new Tween(what, "_yscale", ease, startSize, endSize, 1, true);
var myTween = new Tween(what, "_xscale", ease, startSize, endSize, 1, true);
}
function fadeIn() {
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 +=5;
}else{
delete onEnterFrame;
slideshow();
}
}
};
};
function fadeOut() {
onEnterFrame = function() {
if (picture._alpha > 5) {
picture._alpha -=5;
}else{
picture._alpha = 0;
delete onEnterFrame;
nextImage();
}
};
};
function nextImage() {
if (p<(total-1)) {
p++;
picture._alpha = 0;
zoom(picture,100,90);
if (loaded == filesize) {
picture.loadMovie(image[p]);
desc_txt.text = description[p];
picture_num();
fadeIn();
}
}
};
function firstImage() {
init = true;
picture._alpha = 0;
picture.loadMovie(image[0]);
desc_txt.text = description[0];
picture_num();
fadeIn();
};
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) && !init) {
p = 0;
firstImage();
} else if (p == (total-1) && init) {
p = -1;
fadeOut();
}else{
fadeOut();
}
}
};
View Replies !
View Related
Image Slideshow (fade Into Next With Alpha)
Hi. I'm trying to run a slideshow with each picture fading into the next. i have no idea what the syntax is for this. my basic idea is like this:
// start ------------------------------------------
if (frame > 10) {
for (x = 100; image1.jpg._alpha > 0; X--) {
image1.jpg._alpha = x;
}
}
if (x = 0) image1.jpg._alpha = 100; // once the alpha runs out, this pic is finished so reset and move to other pictures
// end ------------------------------------------
i don't know how to go about doing this with the action script though. i just want to swf to load and begin showing picture. i have the pictures set up but i don't know how to change their _alpha attributes in run time. please point me in the right direction. any help is appreciated.
thanks,
-twistfinger
View Replies !
View Related
Simple Slideshow With Fade Transitions
objective: create a slideshow with back and forward button with actionscripting
conditions: after last image is presented, and after press the "forward" it loads a new movie with loadmovie ("abc.swf",1) condition. Same as the "back" when u arrive at image 1.
The transition effect will be fade between images.
back (loads movie abc.swf) img1 img2 img3 forward (loads movie cba.swf)
hope to be as clear as possible.
View Replies !
View Related
Xml Driven Slideshow With Fade And Resize
i'm trying to build an xml driven slideshow w/resize. If I could target flash player 8 i would use the tween class and this would probaby be easier for me. at any rate I've got the basic function for resize working (haven't even started with the timer to control loading the next image, etc.) It seems to be resizing correctly but it get's jumpy at the very end of the resize. I'm not sure what's causing it but i think it may be the use of
Code:
math.abs
(?). If anyone could take a look that would be great! Also if you can point me in a better direction (if i'm only making trouble for myself doing it in this way) feel free!
thanks for any help!
(attached files are in Flash 8 but will have to target flash player 7 for this)
code:
Code:
spacing = 20;
containerMC._alpha = 0;
theFade=0;
imagesXML=new XML();
imagesXML.ignoreWhite=true;
imagesXML.onLoad=function(success){
if(success){
rootNode=imagesXML.firstChild;
totalSlides=rootNode.childNodes.length;
firstNode=rootNode.firstChild;
trace(firstNode.attributes.url);
loadClip(firstNode);
}
}
imagesXML.load("images.xml");
loadClip=function(nextNode){
container._alpha=0;
trace(nextNode.attributes.url);
container.loadMovie(nextNode.attributes.url);
_root.onEnterFrame = function(){
var bytesT = container.getBytesTotal(), bytesL = container.getBytesLoaded();
if (bytesT != 0 && Math.round(bytesL/bytesT) == 1){
var w = container._width + spacing, h = container._height + spacing;
trace("this is the width: "+w+" this is the height: "+h);
resizeMe(w, h);
delete _root.onEnterFrame;
}
}
}
resizeMe = function(w, h){
var speed = 11;
border.onEnterFrame = function(){
border._width += (w - border._width)/speed;
border._height += (h - border._height)/speed;
if( Math.abs(border._width-w)<1){
border._width = w+spacing/2;
border._height = h;
_root.container._x = border._x - border._width/2 + spacing/2 ;
_root.container._y = border._y - border._height/2 + spacing/2;
delete border.onEnterFrame;
_root.timerClip.gotoAndPlay("start");
}
}
};
View Replies !
View Related
Last Image In Slideshow To Fade Out And Stay There
Hi all,
I've created an image slideshow using XML and AS. I would like the last image (in the XML file) to stop and stay there, but the way that I have it currently the last image goes away. Ideally I would like the last image to stop and fade out a little and then have a button to have the slideshow replay again. So after the last image, I'd like "Replay" text to appear. Any suggestions as to how I can accomplish this?
Also I seem to get the output error message:
Error opening URL "file:///C|/Documents%20and%20Settings/My%20Documents/Folder/FILENAME/undefined"
I'm assuming this is a path/directory error, but I don't know the reason why. My path and files are all in the appropriate location. Any help would be greatly appreciated!
Below is my AS and logically it should work properly but the last image does not fade out and I can't get the restart button to appear. At least for now I'd like the last image to stay. Here's my AS:
delay = 3000;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
//preloader._visible = true;
}
}
xmlData = new XML(); //assign a variable to the new XML object
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML; //tell xmlData to invoke the loadXML func when loaded
xmlData.load("images.xml");
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
slideshow();
}
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
slideshow();
}
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
//Changed p = 0 before; that was resetting your slideshow to go back to the start. The new code says if the current picture is the last one, fade out the picture in 100 milliseconds
endFadeOut = setInterval(fadeOut, 100);
//This assumes that you have made a movie clip called restart_mc that is a button
_root.attachMovie("restart_mc", "restart_mc1", _root.getNextHighestDepth(), {_x:Stage.width/2, _y:Stage.height/2});
restart_mc1.onRelease = function(){
} else {
nextImage();
}
}
//Fade function which checks to see if the alpha is greater than 0 and decreases it by 10 until it equals 0
function fadeOut(){
if (picture._alpha > 0){
picture._alpha -= 10;
}
}
//This would be your restart actions:
restart_mc1.onRelease = function(){
firstImage();
restart_mc1.removeMovieClip();
}
View Replies !
View Related
Slideshow Tutorial: Can I Fade The Pictures Out?
How difficult would it be to make the images fade out the same way they fade in?
Code:
delay = 10000;
//-----------------------
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");
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 += 5;
}
}
};
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();
}
}
}
Any help is appreciated!
View Replies !
View Related
Fade Speed On Slideshow Tutorial
Self- explanatory...all I need to know is how to change the alpha fade in and out speed on the photo slideshow tutorial. Can't find it for the life of me...
Code:
delay = 5000;
//-----------------------
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/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
Xml Slideshow With Resize And Fade (help Scotty)
i'm using the code from the best of kirupa thread about the gallery with resize.
it's working with what i've done with it so far but it's 'jerky' on resize. at the last point of the resize the frame clip jumps to the correct size. I can't seem to get a handle on why it does that.
at this point i'm using a simple clip to control the timing of the fade (if I could target fp 8, i would use the tween class and .onMotionFinished) so that there's a slight delay between the resize and the container clip fading in the image. IF somebody could give me a better method that would be great.
Also, for the loading of the subsequent images, i was planning on using some type of timer (maybe setinterval) to wait for 10 seconds or so until I call the next xml node and load the next image. If anyone can comment on which method is best for a timer situation like that it would also be greatly appreciated.
here's code and i'm attaching my .fla, xml and the first image (only working with that one at this point):
Code:
spacing = 20;
containerMC._alpha = 0;
theFade=0;
imagesXML=new XML();
imagesXML.ignoreWhite=true;
imagesXML.onLoad=function(success){
if(success){
rootNode=imagesXML.firstChild;
totalSlides=rootNode.childNodes.length;
firstNode=rootNode.firstChild;
trace(firstNode.attributes.url);
loadClip(firstNode);
}
}
imagesXML.load("images.xml");
loadClip=function(nextNode){
container._alpha=0;
trace(nextNode.attributes.url);
container.loadMovie(nextNode.attributes.url);
_root.onEnterFrame = function(){
var bytesT = container.getBytesTotal(), bytesL = container.getBytesLoaded();
if (bytesT != 0 && Math.round(bytesL/bytesT) == 1){
var w = container._width + spacing, h = container._height + spacing;
trace("this is the width: "+w+" this is the height: "+h);
resizeMe(w, h);
delete _root.onEnterFrame;
}
}
}
resizeMe = function(w, h){
var speed = 11;
border.onEnterFrame = function(){
border._width += (w - border._width)/speed;
border._height += (h - border._height)/speed;
if( Math.abs(border._width-w)<1){
border._width = w+spacing/2;
border._height = h;
_root.container._x = border._x - border._width/2 + spacing/2 ;
_root.container._y = border._y - border._height/2 + spacing/2;
delete border.onEnterFrame;
_root.timerClip.gotoAndPlay("start");
}
}
};
View Replies !
View Related
Slideshow Using XML To Stop Looping And Fade Out At The End
Hi all,
I know a lot of XML slideshow questions and adaptations have been posted and I've searched but I can't seem to find the answer to my problem. I used the tutorial "Photo Slideshow Using XML and Flash and I've successfully implemented the slideshow to fade in and out, but I don't want the slideshow to loop - ie. to stop looping then stop at the last image and fade out to about 50% and then some text with a clippable link to pop up.
I've used the code from the above mentioned tutorial (http://www.kirupa.com/developer/mx20..._slideshow.htm) and deleted the preloader, next, and previous button AS. And I've modified the slideshow function to make the slideshow not loop by commenting out firstImage (as shown below) but I can't make it fade out. And I've implemented another function called fadeout but it fades out my entire stage. I would only like to fade out the last image and have some text pop up. Here's the AS:
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0; //reset the counter p to 0
//firstImage();
fadeout();
} else {
nextImage();
}
}
}
function fadeout() {
this._alpha -= 50;
if (this._alpha<=0) {
this._alpha = 100;
}
}
Any help, direction is greatly appreciated! Thanks again!
View Replies !
View Related
Slideshow Tutorial: Can I Fade The Pictures Out?
How difficult would it be to make the images fade out the same way they fade in?
Code:
delay = 10000;
//-----------------------
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");
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 += 5;
}
}
};
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();
}
}
}
Any help is appreciated!
View Replies !
View Related
Image Fade Slideshow Recomendations
Can anyone recommend an easy to use slideshow program. All I want to do is show about 5 different images and have them fade from one to another in a loop. that’s it. No play, stop, start buttons of any nature.
I know how to do this in Flash, but I was looking for something a bit easier to create and change every now and again if I needed to.
Much appreciated,
Houston
View Replies !
View Related
Slideshow With Cross-fade Transition
Hey guys... and a happy newyear to all of you
What i want to create is a slideshow, that preloads the next image and does a cross-fade transition with the current when changing.
Kirupa has helped me with this script so far, which loads my pictures from an .xml and fades them in.
ActionScript Code:
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");
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 += 3;
}
}
};
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();
}
}
}
How would i go about implementing a cross-fade transition?
View Replies !
View Related
Slideshow Help Need Fade And Next/prev Buttons
Hi,
I've been searching everywhere for how to do this and I must be missing something. I am fairly new to Flash, but know some basics AS (2.0) and can find my way around.
I need to create a slideshow where the images fade in and out on a three second lag, BUT also provide next and previous buttons in case the user would rather scroll through themselves.
I've found basic slideshows that allow next/prev buttons to work with with the nextFrame script, but I don't know how to get this to work when there are transitions between images because then the next image is not in the next frame. Does that make sense?
Maybe I'm missing something silly here. Maybe someone has a flash file that simulates this that they could share?
THANK YOU so much in advance!
Susie
View Replies !
View Related
Dynamic Slideshow Fade Problem
I have a dynamic slideshow and i would like to fade to white between each photo. I tried adding a layer above the pictures and tweened the alpha from 0 to 100 to 0 again (to create the fade). The problem here is that since i am calling the images it puts it ontop of all the layers. I am wondering if there is a way to tell it not to put the images on top. Or any other suggestions you might have. Thanks.
View Replies !
View Related
[CS3] Flash Slideshow + Effects Fade In/Sound
Hey Guys,
I have an idea for my assignment now basically i want to have a slideshow that goes for 20 seconds which is 240 frames at 12fps/per second... Anyways i was wondering if there would be any particular idea amount of images i should fit in within that 20 second time slot...
Basically the slideshow should go like this
Sketch of concept car shows> Finished rendered image shows this happened for 3/4 of the time and i have sound going in the background as well as any other cool effects that would look good. Then to top it i have the company logo shown then quoted "New Wave Graphics Where The Future is a reality"
So i was using this tutorial and was wondering if anyone had any better ones or ideas that they could suggest?
http://www.tutorial5.com/content/view/128/46/
But yeh i want to make it an auto flash movie no scrolling or crap so factor that in. God i wish i knew flash so much more it yeilds so many practical uses only for me to be limited by my knowledge of the software
Thanks Guys
View Replies !
View Related
Last Image In Slideshow To Fade And Have The Option To Replay
Hello,
I have built a photo gallery/slideshow using the tutorials "Photo Slideshow using XML and Flash" found here:
http://www.kirupa.com/developer/mx20..._slideshow.htm
I would like the last image to stop and fade out a little and then have a button to have the slideshow replay again. So after the last image, I'd like "Replay" text to appear. Any suggestions as to how I can accomplish this?
Also I seem to get the output error message:
Error opening URL "file:///C|/Documents%20and%20Settings/My%20Documents/Folder/FILENAME/undefined"
I'm assuming this is a path/directory error, but I don't know the reason why. My path and files are all in the appropriate location. Any help would be greatly appreciated!
Below is my AS:
_root.holder.swapDepths(_root.picture);
holder._y = 350;
holder._x = 390;
//stop();
delay = 3000;
//-----------------------
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!";
//preloader._visible = true;
}
}
xmlData = new XML(); //assign a variable to the new XML object
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML; //tell xmlData to invoke the loadXML func when loaded
xmlData.load("images.xml");
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
slideshow();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
slideshow();
}
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
} else {
nextImage();
}
}
}
View Replies !
View Related
Slideshow Doesn't Fade Properly On The First Cycle
I have a slide show that displays 6 images and is suppose to do a fade in / fade out (not an overlap fade) between each image. The peculiar behavior is that when the movie is tested
locally by using "Test Movie", the fades occur properly. However when the swf is viewed from the website, during the first cycle of the slideshow, the next image does NOT fade in. After the first cycle, the fade in occurs properly...
http://www.yangwenphotography.com/homepageslideshow.swf
Code:
import mx.transitions.Tween;
var nInterval:Number;
var count:Number = 0;
var currentImage:Number = 1;
var imageDuration:Number = 8;
this.createEmptyMovieClip("empty_mc",1);
_root.empty_mc.loadMovie("still_portfolio/0"+currentImage+".jpg");
mpty_mc._alpha=0;
var mcTween:Tween = new Tween( _root.empty_mc, "_alpha", Strong.easeOut, 0, 100, 1.0, true );
function counter(){
count++;
if(count>=imageDuration){
nextMovie(); // nextMovie is another function which does the changing of images.
clearInterval(nInterval);
count = 0;
nInterval = setInterval(counter, 1000);
}
}
nInterval = setInterval(counter, 1000);
function nextMovie(){
currentImage++;
if(currentImage > 6){
currentImage = 1;
}
var mcTween:Tween = new Tween( _root.empty_mc, "_alpha", Strong.easeIn, 100, 0, 1.0, true );
mcTween.onMotionFinished = function() {
_root.empty_mc.loadMovie("still_portfolio/0"+currentImage+".jpg");
var mcTween:Tween = new Tween( _root.empty_mc, "_alpha", Strong.easeOut, 0, 100, 1.0, true );
}
}
thanks
Yang
View Replies !
View Related
Adding Fade-in To Xml Random Slideshow Flash
hi guys im working on a random slideshow gallery that uses xml to populate the mc, and it works great, but now i want to add a fade-in effect for each 1 of the pics, or maybe a cross-fade,this is the script i have so far, any help will be appreciated.
Code:
pauseTime = 2000;
xmlImages = new XML();
xmlImages.ignoreWhite = true;
xmlImages.onLoad = loadImages;
xmlImages.load("images.xml");
function loadImages(loaded) {
if (loaded) {
xmlFirstChild = this.firstChild;
imageFileName = [];
totalImages = xmlFirstChild.childNodes[0].childNodes.length;
for (i=0; i<totalImages; i++) {
imageFileName[i] = xmlFirstChild.childNodes[0].childNodes[i].attributes.title;
}
randomImage();
}
}
function randomImage() {
if (loaded == filesize) {
var ran = Math.round(Math.random() * (totalImages - 1));
picture_mc.loadMovie(imageFileName[ran], 1);
pause();
}
}
function pause() {
myInterval = setInterval(pause_slideshow, pauseTime);
function pause_slideshow() {
clearInterval(myInterval);
randomImage();
}
}
View Replies !
View Related
Coded Slideshow / External Files / Timed Fade
I have a slideshow that i am making. I have each jpeg loading into a target.
In the timeline i have variable a=a+1, then it goes through the frames with the different code for the timed fading, when the timeline comes back to frame 1 in th movieclip it counts, but only to five and I have 8 jpgs that I am currently testing with.
The code for that is:
a=a+1;
container.attachmovie(a, a, a);
loadmovie(a+".jpgs", container);
so a is the counter, and the movie being attached(jpgs)
? Why would it not count past five. Also the jpgs are not getting the properties of the container mc. Any help?
I realize some of this sounds simple. But I am out of solutions.
View Replies !
View Related
Alpha Fade Slideshow Only Working On First Page Load..
Using Flash 8;
I have designed a "Before-and-After" slideshow using Alpha tweens to slowly fade one image into another. The effect works great, however, it seems that the effect only works on the first time the user enters that page.
If the user clicks the "play again" button, I reload the .swf and want the effect the play again, but it just moves from the first to second image, without the alpha effect transition.
Is there some way to "reset" the .swf to replay the alpha tween effect? Does anyone have any ideas why it would have this behavior?
The site and effect are purely actionscript, so I cannot do something like "goToAndPlay(1)" in the last frame, the entire site is only in the first frame.
I can attach code if needed, or a link to the URL.
thanks!! Dave.
View Replies !
View Related
Random Images Slideshow
i used the flash mx samples file for a pictures slideshow...it works based on 2 buttons (back and fwd)...and on a text field you can type the number of the picture you want to see.
what i want to do is an automatic slideshow...from the beginning to the end going through all the pics...
the pics are loaded from a folder...they are not in the flash file library
View Replies !
View Related
|