XML Slideshow: Issue With Thumbs And Text
Ok.. Still struggling with this.. WAAAYYYY overdue...... I can't seem to load text AND a thumbnail into targets contained in the same clip. The thumbnail mc's which are attached using a 'for' loop to loop through the XML doc are set up like this: Code:
|--> Target Text Field Main Thumb Clip ---------> |--> Thumb Clip --> Target JPG Clip
I can make it work fine with JUST displaying the text, or JUST displaying the thumbnail, but not both together. When I try to add text to the thumbnail clips, the jpg disappears. The fact that i can make them work individually, tells me that most of what i'm doing is right... but I can't make them work together.
Anyone have any idea what might cause something like this. There's kind of a lot of code to go through, so i didn't post it here, but if you think you might have some ideas, let me know and i'll post the files ASAP.
Thanks for any and all thought you might have about this
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-12-2006, 12:52 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
XML Slideshow Thumbs Modification Help
I'm trying to make a few modifications to the XML Slideshow;
I've removed the scrolling, and would like the thumbnails to animate X position when they load; starting off stage and moving on.
I'd also like a black border around the thumbs to appear on Rollover/Click...I have an idea on how this should work, but having trouble implementing it...I'm guessing I'd have to attach another movieclip behind each thumb and set visibility of that clip on rollover.
Any help would be greatly appreciated. Here's the code I'm using with the attempt at animation.
Code:
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_right._x-(target_mc._width+5)*k;
/* begin anim
targX = "thumbnail_mc.t"+k._x;
cX = "thumbnail_mc.t"+k._x-1000;
difX = cX-_root.targX;
setProperty("thumbnail_mc.t"+k, _x, cX-(difX/5));
// end anim */
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);
}
Adding Thumbs To XML Slideshow
Hey Guys,
So i've got a slideshow built based off of Lee's XML Basics tutorial. My question has to do with the fact that i want to add thumbnails of the images that are in the slideshow. the thing i need help with is how to call out the full images from the thumbs while keeping my "last" and "next" buttons, as well as my "1/20", "2/20" in track order wise. i'd also like for the thumb selected to change it's alpha after it is click, so you can know where you are in the thumbs.
i have idea idea how to go about this so if anyone has some suggestions it would really help me out. thanks.
HomePage XML-Driven Slideshow With Thumbs
Hello!
I'm about at the intermediate level now of Flash. I have completed almost every tutorial known to man, with no flash/as background, but I am starting to get a hang of the code. I've sort of skipped a lot of important steps and went straight into learning the video aspects of flash, creating scrollpanes, custom video interfaces, etc. Now I'm going backwards to slideshows, which seem to have similiar concepts.
I'm looking to create a news-style home page photo/headline slideshow.
Example: www.mlb.com
1) Thumbnails below the main image drive the navigation. (Iunderstand how to create seek/skip buttons, these are an alternative option to the user to drive the nav).
2) There will be 5 thumbnails at all times sitting in the same location (static). No scroll panes, no mouseactivated scrolling.
3) Each thumbnail will highlight to show active.
4) Autoplay enabled at about a 7 second increment to go to the next thumbnail and display the next image.
5) Images/thumbnails arranged from newest to oldest (left to right).
6) XML-Driven if possible.
All I need help with is the actionscript. I know XML, I know how to design using the flash interface and how to link. I know how to add captions and all of that stuff. I just need some help with the base code for setting this thing up. I understand the thumnails will be movieclips, all instances will be named unique, how to set up the photoHolder, skip buttons etc. I know how to add rollover effects, how to label button states and call them, etc.
I've seen Lee Brimelow's tutorial on scrolling thumbnail pane slideshows, that as the users move scrolls over it, the thumbnails change. I dont need all of that.
Any help would be greatly appreciated.
Looking forward to a reply. Thanks!
Resizing Thumbs In Thumbnail Slideshow
Hey everyone
Well, been getting everything figured out nicely. Mixing scripts from everywhere on this site haha but I can't seem to figure one thing out. The images I will be using are larger than 300x200, and way larger than the thumbs. How do I have it so that flash will shrink the images down to the right size? I'm going to be busy IRL, and wont have time to make 2 sizes of all the images for my slideshows. So I need flash to do that for me. Can it do that? If so, how do I make the images apear 300x200 and 100x67? Here is my actionscript.
ActionScript Code:
var total;var p = 0;var current;var k = 0;//variables for slideshowvar slide = 1;var delay_slide;//this is the interval between the pics: 6 secondsvar interS = 3000;function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; description = []; thumbnails = []; link = []; total = xmlNode.childNodes.length; for (var 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); link[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue; } loadPic(p); } else { content = "file not loaded!"; }}xmlData = new XML();xmlData.ignoreWhite = true;xmlData.onLoad = loadXML;xmlData.load("slide.xml");///////////////////////////////////// function loadPic(p) { picture.loadMovie(image[p]); picture._alpha = 0; var temp = this.createEmptyMovieClip("tem", 9978); temp.onEnterFrame = function() { var filesize = picture.getBytesTotal(); var loaded = picture.getBytesLoaded(); preloader._visible = true; preloader.preload_bar._xscale = Math.round((loaded/filesize)*100); if (picture._width) { preloader._visible = false; picture.fadeTo(100, 1.1); desc_txt.text = description[p]; slideshow(); picture_num(); picture._alpha += 7; if (picture._alpha>100) { picture._alpha = 100; picture.onRelease = function() { getURL(link[p], "_blank"); }; //if the slideshow is running if (slide) { delay_slide = setInterval(showSlide, interS, total); } delete this.onEnterFrame; } } };}MovieClip.prototype.fadeIn = function() { if (this._alpha<100) { current._alpha -= 10; this._alpha += 10; } else { current._visible = 0; current = this; delete this.onEnterFrame; }};function picture_num() { current_pos = p+1; pos_txt.text = current_pos+" / "+total;}listen = new Object();listen.onKeyDown = function() { if (Key.getCode() == Key.LEFT) { previous_btn.onRelease(); } else if (Key.getCode() == Key.RIGHT) { next_btn.onRelease(); }};Key.addListener(listen);previous_btn.onRelease = function() { p>0 ? (p--, loadPic(p), slide=0) : null;};next_btn.onRelease = function() { p<total-1 ? (p++, loadPic(p), slide=0) : null; slideshow();};//function for the slideshowfunction showSlide(total) { //clear the interval (if there's a slideshow) clearInterval(delay_slide); p<total-1 ? (p++, loadPic(p), setButtons(p)) : (p=0, loadPic(p), setButtons(p));}slide_btn._alpha = 50;slide_btn.enabled = 0;slide_btn.onRelease = function() { this._alpha = 50; this.enabled = 0; stop_btn._alpha = 100; stop_btn.enabled = 1; slide = 1; showSlide(total);};stop_btn.onRelease = function() { clearInterval(delay_slide); slide = 0; this._alpha = 50; this.enabled = 0; slide_btn._alpha = 100; slide_btn.enabled = 1;};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._height)) { if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) { thumbnail_mc._x -= scroll_speed; } else if ((_root._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);}
I have tried doing a search, but can't seem to find how to do it...maybe the code is in front of me and I don't understand it.
And many thanks to the people here. I have learned much just looking threw the forums.
Thanks for any help
Looping Slideshow + Scrolling Thumbs
I'm brand new to flash & actioscript and all else in between, so if any of the following appears naive it's because, well, I am naive
First let me say that I’m immensely (immensely) grateful to kirupa.com and all the great tutorials, information, and codes you all have so generously posted out there. I’d not have learned half of what I have so far without all this support!
Okay, so here’s what I’m trying to accomplish:
I’d like to create a slideshow that loops on “play” but that also has pause/prev/next buttons to give users more control of how fast the images appear. I’d really really like to incorporate scrolling thumbs here – a sort of fancy progress bar if you like, that would allow users to get to the middle of the show faster and start there (I’m dealing with quite a number of images, too, I should add).
What I’ve done so far:
I’ve taken the tutorials that seemed relevant:
Slideshow
http://www.kirupa.com/developer/mx2004/xml_slideshow.htm
http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm
Photogallery with thumbs
http://www.kirupa.com/developer/mx2004/thumbnails.htm
I even paid close attention to the explanations of code etc. – may not have understood every word, but I did pick up a few things.
And it occurred to me that I could just combine the codes for the slideshow and the one with the scrolling thumbs. SO I did, and it worked – but only partially. The prev/next buttons do work, but they interfere with the interval & cause some interesting-but-not-necessarily-so-great effects.
Questions:
IF this is a good approach,
1. How do I add play/pause buttons to this?
2. how do I get the thumbnail code to “talk” more effectively to the slideshow code – so that if a user clicks on a thumb, the slideshow either stops (and gives the user control of restarting) OR just continues from that point forward?
OR – 3. Is there a better approach to doing what I’d like to accomplish here?
Any and all pointers are more than welcome – but do bear in mind you’re dealing with a very lay (but willing to learn some harder stuff) person here! Many thanks --
Slideshow With Scrolling Thumbs External Xml Jpg
hello,
i wish to create a slideshow and have the user able to scroll to a sertain img via scrollable thumbs down the bottom. also have the images loaded in using xml.
but i do not know how to start could any1 supply me with a tutorial or as code would appreciate it
thankyou
Home Page XML-Driven Slideshow W/ Thumbs
Hello!
I'm about at the intermediate level now of Flash. I have completed almost every tutorial known to man, with no flash/as background, but I am starting to get a hang of the code. I've sort of skipped a lot of important steps and went straight into learning the video aspects of flash, creating scrollpanes, custom video interfaces, etc. Now I'm going backwards to slideshows, which seem to have similiar concepts.
I'm looking to create a news-style home page photo/headline slideshow.
Example: www.mlb.com
1) Thumbnails below the main image drive the navigation. (Iunderstand how to create seek/skip buttons, these are an alternative option to the user to drive the nav).
2) There will be 5 thumbnails at all times sitting in the same location (static). No scroll panes, no mouseactivated scrolling.
3) Each thumbnail will highlight to show active.
4) Autoplay enabled at about a 7 second increment to go to the next thumbnail and display the next image.
5) Images/thumbnails arranged from newest to oldest (left to right).
6) XML-Driven if possible.
All I need help with is the actionscript. I know XML, I know how to design using the flash interface and how to link. I know how to add captions and all of that stuff. I just need some help with the base code for setting this thing up. I understand the thumnails will be movieclips, all instances will be named unique, how to set up the photoHolder, skip buttons etc. I know how to add rollover effects, how to label button states and call them, etc.
I've seen Lee Brimelow's tutorial on scrolling thumbnail pane slideshows, that as the users move scrolls over it, the thumbnails change. I dont need all of that.
Any help would be greatly appreciated.
Looking forward to a reply. Thanks!
XML Gallery With Thumbs And Slideshow: Buttons Won't Work
Hi everyone..
Im having seriously problems with my gallery
right now nothing works!
The code is base on the toturial on Kirupa.com
I managed to add the slideshow, so it worked.. for awhile atleast. But right now, I don't know what I've done, now my next_btn och previous_btn don't work. The wierd thing is that i can change pic with the LEFT RIGHT KEY on the keyboard.. and they are using the same code. So it can't be something wrong with my AS, I think..
Tho, i got the buttons to work once more. The thing i did was copying the orginal buttons from the toturial fla, and pasted it into my, then it work again for some time. I don't know what im doing that makes the buttons stop working.
Here is what my code look like right now:
Code:
my_int = 3000;
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("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();
disp_size = filesize + " kb";
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();
}
}
///////picture menu button actions ///////
stop_btn.onRelease = function() {
clearInterval(myInterval);
}
slideshow_btn.onRelease = function() {
myInterval = setInterval(pause_slideshow, delay);
}
popup_btn.onRelease = function() {
}
previous_btn.onRelease = function() {
previousImage();
}
next_btn.onRelease = function() {
nextImage();
}
///////////////////////////////////////////
off_btn.onRelease = function() {
clearInterval(myInterval);
}
on_btn.onRelease = function() {
nextImageSlideshow();
}
function firstImageSlideshow() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();
}
}
function nextImageSlideshow() {
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 picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 20;
tscroller.onEnterFrame = function() {
if ((this._ymouse>=thumbnail_mc._y) && (this._ymouse<=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);
}
//////////////////////////////////////////////////////
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
}
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImageSlideshow();
} else {
nextImageSlideshow();
}
}
Would be soo happy if some one could sort the problem out for me
This is really frustrating..
XML Photo Gallery With Thumbs And Dynamic Resize Issue
I'm looking for some advice on a incorporating thumbs to my photo gallery, and am having some problems making them work. My photos need to be resized dynamically as they are different sizes and this is working beautifully but I can't for all that's holy get the thumbs to work as they do so well in the "adding thumbnails" tutorial. Would love any assistance.
Thanks so much...
here's the code...maybe this may help piece together the problem.
FLASH ::
title_txt.htmlText = "<font color="#000000">Title: </font><font color="#FFFFFF">Splash Screen</font>";
/* Debug Variables */
//debug = 1; //Comment this "debug" line to stop the movie from 'tracing' or 'outputting'
holderMC._alpha = 0;
var picArray = new Array();
var tempArray = new Array();
var thumbNailArray = new Array();
var SPACING = 10;
var DEPTH = 0;
var xmlFILE = "gallery.xml";
function printer(str)
{
// If debug flag is set, output different operation in the movie
debug ? trace(str) : null;
}
MovieClip.prototype.loadPic = function(pic)
{
picnum_txt.text = (pic+1) + "/" + NUMOFPICS; // Add one to the 'pic' var since an array starts at 0
printer("STATUS: Loading Picture " + pic);
holderMC._alpha = 0;
cur = pic;
if (pathToPICS.length > 1)
{
this.loadMovie(pathToPICS+picArray[pic]);
}
else
{
this.loadMovie(picArray[pic]);
}
this._parent.onEnterFrame = function()
{
var t = holderMC.getBytesTotal(), l = holderMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1 && holderMC._width>0)
{
var w = holderMC._width+SPACING, h = holderMC._height+SPACING;
border.resizePic(w, h, pic);
delete this._parent.onEnterFrame;
}
};
};
MovieClip.prototype.resizePic = function(w, h, pic)
{
var speed = 3;
holderMC._alpha = 0;
this.onEnterFrame = function()
{
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
title_txt.htmlText = "<font color="#000000"><b>Currently Viewing:</b></font> " + "<font color="#FFFFFF">" + tempArray[pic] + "</font>";
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1)
{
this._width = w;
this._height = h;
holderMC._x = this._x-this._width/2+SPACING/2;
holderMC._y = this._y-this._height/2+SPACING/2;
holderMC._alpha += 5;
if (holderMC._alpha>90)
{
holderMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success)
{
if (success)
{
printer("RESULT: XML File Loaded!");
var gallery = this.firstChild;
pathToPICS = gallery.attributes.picturePath;
NUMOFPICS = gallery.childNodes.length;
printer("Number of Pics: '" + NUMOFPICS + "'");
printer("Path to Pics: '" + pathToPICS + "'");
for (var i = 0; i<NUMOFPICS; i++)
{
tempArray.push(gallery.childNodes[i].attributes.title);
picArray.push(gallery.childNodes[i].attributes.source);
thumbNailArray.push(gallery.childNodes[i].attributes.thumbNail);
thumbnails_fn(i);
}
//loading first picture
holderMC.loadPic(0);
// Button Code
prev.onRelease = function()
{
if (cur == 0)
{
/* Uncomment this line if you want the pictures to start over after it reaches the first image in the array */
//holderMC.loadPic(picArray.length-1);
}
else
{
holderMC.loadPic(cur-1);
}
};
next.onRelease = function()
{
if (cur == picArray.length-1)
{
/* Uncomment this line if you want the pictures to start over after it reaches the last image in the array */
//holderMC.loadPic(0);
}
else
{
holderMC.loadPic(cur+1);
}
};
}
else
{
printer("ERROR: XML File NOT Loaded '" + xmlFILE +" '");
}
};
gallery_xml.load(xmlFILE); // Load the xml file
printer("XML File: " + xmlFILE);
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(thumbnail[k], "thumbnail_mc.t"+k);
}
XML ::
<?xml version="1.0" encoding="UTF-8"?>
<gallery picturePath="exhibitdesign/" >
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="001_shaw_center002.jpg" thumbnail="th0.jpg"/>
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="002_shaw_center001.jpg"/>
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="003_shaw_center005.jpg"/>
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="004_shaw_center019.jpg"/>
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="005_shaw_center021.jpg"/>
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="006_shaw_center004.jpg"/>
<image title="EXHIBIT DESIGN Shaw Center for the Arts Baton Rouge, LA" source="007_shaw_center010.jpg"/>
</gallery>
<!--
Exif Info
-->
Thanks in advance.
V3 With Thumbs Scrolled Photo Gallery With 80x80 Not 40x40 Thumbs Problem
Hi I've been testing out the V3 with thumbs scrolled .fla from this topic
http://www.kirupa.com/forum/showthre...rolling+thumbs
well basically i've been trying to modify it to accept images for the thumbs as 80x80 not 40x40 no matter how much modding i try to do (and i'm crap at actionscript verymuch a newbie) i can only stretch all the 40x40 images and the 80x80 images are oversized for the buttons?
should i be testing all the images as 80x80 or is there something i'm missing (all the images will be 80x80 in the end)
Cheers guys for any suggestions
XML Photo Gallery W/Thumbs - Code For Loading SWFs Instead Of JPGs For Thumbs?
Hi, all,
I'm using Flash CS3 and have built a slide show using the excellent XML Photo Gallery tutorial, as well as adding sound thanks to another post in this forum. It's all working like a charm. The only bad thing is: I want to place .swfs files where the dynamic text is right now, and can't figure out how to do it.
What I really want is one large image/JPG on each slide, and below that, instead of the dynamic text shown in the tutorial example, a smaller .swf file should appear. (For this project, the text itself needs to be animated, and I can't do that with the <caption>/dynamic text option; I need to insert an SWF.) I'd really like to do this using XML since that's working so nicely otherwise.
Can anyone provide me with the actionscript code to use in the context of this photo gallery? I'm not advanced enough yet to know where or how to place code that doesn't fall into this gallery/AS format.
(I'm not being lazy: I have looked all over these forums for hours, read through about 60 pages of tutorials, went through the whole XML Photo Gallery with Thumbnails hoping I could somehow alter that to meet this project's needs... no dice. I had gotten far enough in that tutorial to be able to insert an empty movie clip where I want it, but could only figure out how to fill it with JPGs from the XML, not SWFs... and in any case the images did not then work correctly while advancing the slides.)
Here is my current Actionscripit code:
************************************************** *****
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
audio = [];
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;
audio[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("infant_images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.SPACE) {
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 = false;
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];
sound = new Sound();
sound.loadSound(audio[p],true)
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
sound = new Sound();
sound.loadSound(audio[p],true);
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
sound = new Sound();
sound.loadSound(audio[0],true)
}
}
function loadSound() {
if (loaded == filesize) {
createEmptyMovieClip("sound_mc",2);
sound_mc.sound_obj = new Sound();
sound_mc.sound_obj.loadSound( sound[p], true);
sound_mc.sound_obj.play();
}
}
************************************************** *****
(It's not showing the preloader and is missing the counter AS on purpose; I don't need those items for this project...)
Thank you for any help you can give!!
Create MovieClip Thumbs And Text?
Forgive me if I am a Dumbass, but I have been trying to create a movieclip that contains a thumnail holder with a dynamic text box loaded from XMLand I am lost basically I want a movie clip that I can as needed add images to that will have a text box that appears beside each image , I want it to be able to go by homany nodes there are in my XML so the movie clip that holds everything grows as I add another node and that node creates a thumnail_mc and a dynamic textbox beside it that loads the Image discription.
anyone ???????????
To Load Thumbs And Text From A File.txt
hi
i'm using this AS to load thumbs and pictures from a file.txt : now i need to add a little explain for each photo in a textfield (dida_txt), using the same file.txt or an other.... I tried like below but this obtain just to load the name of pictures in the folder (1.jpg,2jpg etc)
somebody can help me?? thank's a lot
CODE
loadVariables("store.txt", this);
this.onData = function() {
alleBilder = new Array();
alleBilder = bildnamen.split(",");
createEmptyMovieClip("mc_bild", 1);
setArray(0);
};
pS = 1;
pR = 7;
max = pS*pR;
function setArray(pT) {
spielLevel = new Array();
for (var m = 0; m<pS; m++) {
spielLevel[m] = [];
for (var n = 0; n<pR; n++) {
spielLevel[m].push(alleBilder[pT++]);
}
}
tabelle(70, 8, 60, 60);
}
function tabelle(posX, posY, pB, pW) {
for (i in this.mc_bild) {
if (typeof (this.mc_bild[i]) == "movieclip") {
this.mc_bild[i].removeMovieClip();
}
}
tiefe = 0;
for (var i = 0; i<spielLevel[0].length; i++) {
for (var j = 0; j<spielLevel.length; j++) {
nName = "block_"+i+"_"+j;
this.mc_bild.attachMovie("contclip", nName, tiefe++);
this.mc_bild[nName].nummer = i;
this.mc_bild[nName].bildname = "store/"+spielLevel[j][i];
this.mc_bild[nName].titoli = spielLevel[j][i];
this.mc_bild[nName]._x = posX+pB*i*1.2;
this.mc_bild[nName]._y = posY+pW*j*1.2;
this.mc_bild[nName].onRollOver = function() {
dida_txt.text = this.titoli;
the wrong line is, i now,
this.mc_bild[nName].titoli = spielLevel[j][i];
but what's the solution ???
XML Slideshow Issue
I have been working on an XML slideshow that can use SWF files or JPGs. I added controls to move forward or backward through the slides, and I only want these controls to be viewable if the person rolls over the slideshow.
I have a button instance on the bottom layer that functions as a link for each slide. I can use this button onRollover to trigger the controls to be visible, but when I mouse over the actual controls, they disappear because onRollout I make them not visible.
I am looking for a way to keep the controls visible when I rollover the movie, including when I try to use the controls, and then hide them again when I roll out of the movie.
I have searched allover, but it is a pretty tough issue to explain.
Thanks for your help.
XML Slideshow Issue
I've written a simple XML slideshow - it loads the data in from the file, and then loads the image, and advances as you click.
I'm trying to have the images crossfade, but for some reason it's not working. I have two separate containers the images get loaded in to, and I know it's getting loaded into each clip properly, but everytime it switches, the old clip is emptied?
Any tips?
ActionScript Code:
import caurina.transitions.Tweener;
var loadRand = "?" + Math.round(Math.random()*10000);
loadRand = "";
var i:int = 0;
var slideCounter:int = 0;
var slideImg:Array = new Array();
var slideCap:Array = new Array();
var curSlide = 0;
var numSlides:Number;
var xmlLoader:URLLoader = new URLLoader();
var slideLoader:Loader = new Loader();
var delay = 2000;
var imgPath;
var slideMc1 = new slide();
var slideMc2 = new slide();
slideMc1.name = "slideMc1";
slideMc2.name = "slideMc2";
slideMc1.alpha = 0;
slideMc2.alpha = 0;
slideMc2.x = 50;
slideContainerMc.addChild(slideMc1);
slideContainerMc.addChild(slideMc2);
var topSlide = slideMc2;
var loadingSlide = slideMc1;
loadXML();
function loadXML() {
xmlLoader.load(new URLRequest("xml/slideshow.xml" + loadRand));
xmlLoader.addEventListener(Event.COMPLETE, xmlComplete);
}
function xmlComplete(e:Event):void {
//xml variable
var xml:XML = new XML(e.target.data);
//number of navigation items
numSlides = xml.slide.length();
for (i=0; i<numSlides; i++) {
slideImg.push(xml.slide.img.text()[i]);
slideCap.push(xml.slide.img.text()[i]);
}
loadSlide(e);
}
function loadSlide(e:Event) {
if (curSlide==numSlides) {
curSlide = 0;
}
slideLoader.load(new URLRequest(slideImg[curSlide]));
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, slideComplete);
}
function slideComplete(e:Event) {
if (topSlide == slideMc1) {
loadingSlide = slideMc2;
} else {
loadingSlide = slideMc1;
}
loadingSlide.alpha = 0;
loadingSlide.addChild(slideLoader);
slideContainerMc.swapChildren(topSlide, loadingSlide);
Tweener.addTween(loadingSlide, {alpha:1, time:1});
topSlide = loadingSlide;
curSlide++;
}
slideContainerMc.addEventListener(MouseEvent.CLICK, loadSlide);
slideContainerMc.buttonMode = true;
XML Video Playlist W/ Thumbs Text Doesn't Show Up
I followed Todd's tutorial very closely, but my vDesc and vName text fields don't load the text from the xml file. It is also buggy in general because it doesn't act consistently. Also, is there a tutorial that shows how to modify the playlist to have a conventional scroll wheel instead?
Here is the FLA and XML file. Please help me out:
http://www.sendspace.com/file/plqni6
--
Slideshow Delay Issue
HI
I have several swf´s with different slideshows based on a "Slideshow using xml tutorial" from
tutorial link
These slideshow swf´s are loaded into a movie clip within my main swf. by using the loadMovie command when pressing the corresponding Button.
The swfs are loaded and the slideshows are displayed.
The problem is that the delays between the slides don´t work correctly.
When loading the first external slideshow swf into the movie clip the delays seem to run at the correct interval set within that swf, however if another swf is then loaded into the mc to replace the current slideshow swf the delay times seem to run randomly.
I suspect that the interval function from the previously loaded swf is affecting the interval within the currently loaded swf. This does not make any sense to me.
I am lost
I have included a mock up as an attachement.
could someone please have a look
Actionscript Slideshow Issue
I'm having a problem with a slideshow, it works fine in flash player 6 but when i switch to 8, it doesn't work here's the code.
Quote:
//this creates the easing to the slideshow as it moves from top to bottom
onClipEvent (load) {
accel =0;
rate = 0.05;
trace(_y)
_root.ykoord=20.5;
}
onClipEvent(enterFrame) {
y=y*accel+(_root.ykoord-_y) * rate;
_y+=y;
if(Math.abs(_root.ykoord-_y)<1) { _y=_root.ykoord; }
}
Quote:
// this is the button as
on (rollOver) {
gotoAndPlay("S1");
}
on (releaseOutside, rollOut) {
gotoAndPlay("S2");
}
on (release) {
if (_root.ykoord>-200) {
_root.ykoord -= 308;
}
}
Thanks any help would be appreciated
Issue With Kirupa Slideshow
I have used the script from this link:
http://www.kirupa.com/developer/mx/photogallery.htm
The swf file works correctly, but when it is published, the images to not load. Do I need to have the full path listed for the array?
this.pathToPics = "flashimages/";
If anyone knows, please let me know!
Thanks!
Slideshow Preloading Issue
hello pixel lovers,
I grabbed the script from kirupa and tried to apply it to the movie but got a preloading issue...
- http://www.dogsname.com/huelster
The problem is with the preloading and the interval i believe, it really works well in the flash downloading simulation but goes crazy online. The slideshow should start only when the preloading of each picture is over. Here it seems that the slideshow continue playing even if the picture is not fully loaded.
Hope you can figure that mystery for me.
Thanks for your help amigo,
Val.
Here's the beastie //////////////////////
stop();
portfolioInfo = new XML();
portfolioInfo.ignoreWhite = true;
portfolioInfo.onLoad = loadXML;
portfolioInfo.load("GALLERY/intro.xml");
function loadXML(loaded, filesize) {
count = this.firstChild.childNodes.length;
currentIMAGE = [];
for (i=0; i<count; i++) {
currentIMAGE[i] = this.firstChild.childNodes[i].attributes.IMAGE;
firstImage();
}
}
p = 0;
function nextImage() {
if (p<(count-1)) {
p++;
if (loaded == filesize) {
_root.image_mc._alpha = 0;
_root.image_mc.loadMovie(currentIMAGE[p]);
}
} else if (p == (count-1)) {
p = 0;
if (loaded == filesize) {
_root.image_mc._alpha = 0;
_root.image_mc.loadMovie(currentIMAGE[p]);
}
}
}
//
function firstImage() {
if (loaded == filesize) {
_root.image_mc._alpha = 0;
_root.image_mc.loadMovie(currentIMAGE[0]);
slideshow();
}
}
//
delay = 3000;
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
nextImage();
}
}
// ====== preloader
this.onEnterFrame = function() {
filesize = image_mc.getBytesTotal();
loaded = image_mc.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (image_mc._alpha<100) {
image_mc._alpha += 10;
}
}
};
/////////////////
I Cant Find The Issue With This Slideshow
this is stupid! lol I have this slideshow, that blends, works beautifully right up until the 23rd transition then all hell breaks loose!! not sure where the issue is:
This is just a prototype to get the trans perfect, here's my code
ActionScript Code:
n = -1;i = 0;d = 9999999999;secondDelay = (seconds=2)*30;ims = new Array("pic1", "pic2", "pic3");function swap() { this.attachMovie(ims[n], "Pic"+(++i), d--, {_alpha:0, timeOut:secondDelay, onEnterFrame:fadeIn});}function cng() { n<ims.length-1 ? n++ : (n=-1, cng(), swap()); trace(ims[n]);}function fadeIn() { this._alpha<100 ? this._alpha++ : (delete this.onEnterFrame, this.onEnterFrame=countDown);}function countDown() { this.timeOut>0 ? this.timeOut-- : (delete this.onEnterFrame, this.onEnterFrame=fadeOut, cng(), swap());}function fadeOut() { this._alpha>1 ? this._alpha-- : this.removeMovieClip();}cng(), swap();
Slideshow Issue Due To Actionscript Missing Something?...
I honestly don't know if this was written in Actionscript 1 or 2. All I know is it doesn't work.
Basically it's a photo slideshow that scrolls images by (clickable images to go to a relevant page), images which are determined by a string in the embed src part of html:
<embed src="/slideshow.swf?pfad=/photos/&images=1.jpg§1.html|2.jpg§2.html" ...>
Anyway, I found the code somewhere but no matter what I try I can't seem to get it to load the images or work. Below is the actionscript from the flash file (that's all there is in the flash file...). Is it missing a vital component? Also, how would it be possible to include something in the flash to call to a separate txt file for the images (rather than a string in the html)?
---start code---
function changePic()
{
var _loc1 = _root;
if (_loc1.loading == false)
{
_loc1.pic = _loc1.imageArray[counter][0];
_loc1.path = _loc1.imageArray[counter][1];
objOld = newPic;
newPic = _loc1.attachMovie("picClip", "picClip" + counter, counter);
newPic.loadMovie(pfad + _loc1.pic);
loadPic = setInterval(newPic.preLoad, 2, newPic);
counter = counter < _loc1.imageArray.length - 1 ? (++counter) : (0);
} // end if
} // End of the function
var tempArray = _root.images.split("|");
_root.imageArray = new Array();
var i = 0;
while (i < tempArray.length)
{
_root.imageArray[i] = tempArray[i].split("§ ");
++i;
} // end while
MovieClip.prototype.moveIn = function (xEnd, Factor)
{
var _loc1 = this;
_loc1._x = Stage.width;
_loc1.onEnterFrame = function ()
{
var _loc1 = this;
_loc1._x = _loc1._x + (xEnd - _loc1._x) / Factor;
if (_loc1._x > xEnd - 1 && _loc1._x < xEnd + 1)
{
_loc1._x = 0;
_root.loading = false;
delete _loc1.onEnterFrame;
} // end if
};
};
MovieClip.prototype.moveOut = function (xEnd, Factor)
{
var _loc1 = this;
_loc1._x = 0;
_loc1.onEnterFrame = function ()
{
var _loc1 = this;
_loc1._x = _loc1._x + (xEnd - _loc1._x) / Factor;
if (_loc1._x > xEnd - 1 && _loc1._x < xEnd + 1)
{
unloadMovie(_loc1);
delete _loc1.onEnterFrame;
} // end if
};
};
MovieClip.prototype.preLoad = function (objNew)
{
var _loc1 = objNew;
if (_loc1.getBytesTotal() > 4 && _loc1.getBytesLoaded() == _loc1.getBytesTotal())
{
_loc1.moveIn(0, 8);
objOld.moveOut(-Stage.width, 8);
_loc1.onPress = function ()
{
getURL(_root.path, "_top");
};
clearInterval(loadPic);
return;
} // end if
if (_loc1.getBytesTotal() > 4 && _loc1.getBytesLoaded() < _loc1.getBytesTotal())
{
prozent = Math.ceil(_loc1.getBytesLoaded() / _loc1.getBytesTotal() * 100);
_root.loading = true;
} // end if
};
counter = random(_root.imageArray.length);
_root.loading = false;
changePic();
setInterval(changePic, 6000);
Slideshow Image Scaling Issue - Please Help
Hi everyone,
This is my very firtt post here. I am quite new to AS and this place is helping me so much, so thanks everyone in advance!
Here´s my problem:
I have been trying to use the XML image slideshow posted here and everything works but one thing. The images to load which have the same px dimensions as the mask for the container will keep scaling up for a reason I can´t find in the code. I have been trying to fix this all day without any luck and I am about to go mad here. I am using FCS3 but saving a F8 doc with AS2.
Could anyone take a look to the file and tell me what the problem could be?
Thanks a lot in advance!
[F8] Flash Website, Slideshow Links Issue
Hey all,
I've been trying to make a flash website, almost done, but ran into a little snag.
So basically, I have the website as one flash movie. One one of the pages, I wanted a slideshow to show off some pictures. I made the slideshow in another flash document, imported it, and placed it in.
My slideshow is a set of 10 pictures, fading in and out using motion tweens. I have a button at the bottom, that is supposed to replace the first slideshow with a second slideshow. The link works fine and does what it's supposed to do (done with loadMovie) But when I put it on my website movie and test it, I can't click on the button. Can anyone help me out?
Visual layout:
Layer 1 (Main website)
Layer 2 (Slideshow Movie inside webpage)
Layer 3 (Button inside slideshow)
Thanks in advance,
GuyFromCanada
Flash Slideshow Pan And Zoom Quality Issue
Put this together for a client, but as you can see the images wiggle and compress and stretch slightly as they move across the frame. Anyone have any solutions aside from purchasing third party software? Thanks in advance.
http://www.tiny.cc/KdwrP
Simple Slideshow: LoadVars, Undefined Trace...scope Issue?
I'm making a simple slideshow (Flash MX 2004 V7.2).
I'm using LoadVars to access an outside text document to get the number of slides used in the slideshow (path: vars/slideInfo.txt, totalFrames=4).
Now I KNOW this is elementary, and I know it is something I'M doing/not doing, but I can't get my slideshow to recognize: totalFrames=4 (unless I hardcode it in!).
Using trace I get "undefined" everywhere in my code except within my .onLoad function statement which traces the number correctly: 4 (or whatever I change it to).
From hours of internet searching I think this may be a scope issue.
I've tried adding additional code to fix this (my last efforts reflected below). Still I can't get the number of slides out of this function to be used by the rest of the slideshow.
Will someone please point out what I'm doing wrong (I know I'll feel stupid but I'll still appreciate it!)?
Thanks!
Trace Output from below code:
undefined
undefined
4
4
Code:
var totalFrames:Number;
var slideInfoLV:LoadVars = new LoadVars();
var totalFrames:Number;
trace(totalFrames); //output: undefined
slideInfoLV.onLoad = function(success:Boolean) {
if (success) {
slideCounter();
trace(this.totalFrames); //output: 4
totalFrames = this.totalFrames;
trace(totalFrames); //output: 4
} else {
frameNum.text = "error";
}
};
slideInfoLV.load("vars/slideInfo.txt");
trace(totalFrames); //output: undefined
[CS3] Still Having Clock Time Zone Issue---and Dynamic Text Box Issue
I'm trying to do a clock that displays another time zone. The problem I'm having is that instead of running on a 12 hour clock, its on a 24hr one.
any insight as to how I can change the time?
Currently the clock is displaying
23:00p-Jul.22
I want it to display 11:00p-Jul.22
var dayText:String;
var dateText:String;
var monthText:String;
var AmPm:String;
_root.onEnterFrame = function() {
var myDateate = new Date();
//var sec:Number = myDate.getSeconds();
var min:Number = myDate.getMinutes();
var hour:Number = myDate.getHours();
var day:Number = myDate.getDay();
var date:Number = myDate.getDate();
var month:Number = myDate.getMonth();
//var year:Number = myDate.getFullYear();
//sec = sec<10 ? "0"+sec : sec;
min = min<10 ? "0"+min : min;
//AM/PM
if (hour>12) {
hour = hour-12;
AmPm = "p";
} else {
AmPm = "a";
}
//day
if(date == 1 || date == 21 || date == 31) {
dateText = date+"";
} else if(date == 2 || date == 22) {
dateText = date+"";
} else if(date == 3 || date == 23) {
dateText = date+"";
} else {
dateText = date+"";
}
//month
if (month == 0) {
monthText = "jan";
} else if (month == 1) {
monthText = "feb";
} else if (month == 2) {
monthText = "mar";
} else if (month == 3) {
monthText = "apr";
} else if (month == 4) {
monthText = "may";
} else if (month == 5) {
monthText = "jun";
} else if (month == 6) {
monthText = "jul";
} else if (month == 7) {
monthText = "aug";
} else if (month == 8) {
monthText = "sep";
} else if (month == 9) {
monthText = "oct";
} else if (month == 10) {
monthText = "nov";
} else if (month == 11) {
monthText = "dec";
}
//display
dateDisplay.text = hour+":"+min+ AmPm + "-" + monthText+"."+ dateText;
};
[F8 AS2] SlideShow Transition (and) "LED Button" Issue
(Flash8, AS2.0)
I'm doing some modifications to a flash slideshow off of kirupa.com.
http://www.kirupa.com/developer/mx20..._slideshow.htm
I've made some modifications and here's what I've finished so far.
http://www.superclubs.com/index_b.asp
My first question is about the transitioning between slides. I need the images to transition from image into the next without showing blank space in-between. Here's a perfect example of what I mean.
http://www.sandals.com
Currently mine flashes to an off-white bg before fading in the next image, and for some reason I can't seem to change this without breaking it.
The images that load are displayed in a clip named 'picture'. When the next image loads, the picture alpha is set to 0, changed to the next image, and faded back in. I thought it would be an easy fix to simply duplicate the picture instance, set it on top and fade it out after the original picture mc has been switched to the next picture. This would create an effect of fading from one image to the next.
For some reason the way the original code was written, none of my attempts to do this have worked and I'm really just stuck. I can't even seem to figure out where to insert a bit of fadeout code to at least make the image fade to white before fading in the next image.
---------------------------------------------------
Second question...
I need the small row of squares ("LED buttons") in the upper right corner to light up corresponding to whichever image is being shown at the moment (i.e. third image pops up, so third LED lights up).
What's causing me the biggest headache in figuring this out is that all those little squares are created at runtime, depending on how many images have been defined in the external xml file. They're created and named 1 through x where x = number of images. The rollover and links where generated using code inside the LED clip and not each individual instance.
Here's my code:
PHP Code:
delay = 9000;
var nextDepth:Number = this.getNextHighestDepth();
function loadXML(loaded){
if(loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
propTitle = [];
propInclusive = [];
propRating = [];
propLocation = [];
propInfo1 = [];
propInfo2 = [];
propInfo3 = [];
propInfo4 = [];
propInfo5 = [];
propInfo6 = [];
propLink = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = "flashphotos/" + xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
propTitle[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
propInclusive[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
propRating[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
propLocation[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
propInfo1[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
propInfo2[i] = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue;
propInfo3[i] = xmlNode.childNodes[i].childNodes[8].firstChild.nodeValue;
propInfo4[i] = xmlNode.childNodes[i].childNodes[9].firstChild.nodeValue;
propInfo5[i] = xmlNode.childNodes[i].childNodes[10].firstChild.nodeValue;
propInfo6[i] = xmlNode.childNodes[i].childNodes[11].firstChild.nodeValue;
propLink[i] = xmlNode.childNodes[i].childNodes[12].firstChild.nodeValue;
}
//// LED GENERATOR
for (j=0; j<total; j++){
var offSet:Number = (j * 10);
ledContainer.attachMovie("ledOff_mc", "off" + j, nextDepth + j,
{_height:12, _width:8, _x:offSet});
}
for (j=0; j<total; j++){
var offSet:Number = (j * 10);
ledContainer.attachMovie("ledOn_mc", j, nextDepth + total + j,
{_height:12, _width:8, _x:offSet});
}
//// LED onROLLOVER/onRELEASE CODE LOCATED IN 'ledOn_mc' MOVIE CLIP
firstImage();
} else {
content = "file not loaded!";
};
};
//// RUNTIME START ////
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("flashimages.xml");
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
if (picture._alpha<100){
picture._alpha += 15;
}
loadingClock._alpha = 0;
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 3);
desc_txt.text = description[p];
this.propTitle_txt.text = propTitle[p];
this.extendedDesc.propInclusive_txt.text = propInclusive[p];
this.extendedDesc.propRating_txt.text = propRating[p];
this.extendedDesc.propLocation_txt.text = propLocation[p];
this.extendedDesc.propInfo1_txt.text = propInfo1[p];
this.extendedDesc.propInfo2_txt.text = propInfo2[p];
this.extendedDesc.propInfo3_txt.text = propInfo3[p];
this.extendedDesc.propInfo4_txt.text = propInfo4[p];
this.extendedDesc.propInfo5_txt.text = propInfo5[p];
this.extendedDesc.propInfo6_txt.text = propInfo6[p];
if(this.extendedDesc.propRating_txt.text == "undefined"){
this.extendedDesc.propRating_txt.text = " ";
}
picture_num();
slideshow();
};
};
};
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 3);
desc_txt.text = description[0];
this.propTitle_txt.text = propTitle[0];
this.extendedDesc.propInclusive_txt.text = propInclusive[0];
this.extendedDesc.propRating_txt.text = propRating[0];
this.extendedDesc.propLocation_txt.text = propLocation[0];
this.extendedDesc.propInfo1_txt.text = propInfo1[0];
this.extendedDesc.propInfo2_txt.text = propInfo2[0];
this.extendedDesc.propInfo3_txt.text = propInfo3[0];
this.extendedDesc.propInfo4_txt.text = propInfo4[0];
this.extendedDesc.propInfo5_txt.text = propInfo5[0];
this.extendedDesc.propInfo6_txt.text = propInfo6[0];
if(this.extendedDesc.propRating_txt.text == "undefined"){
this.extendedDesc.propRating_txt.text = " ";
};
picture_num();
slideshow();
};
};
function picture_num() {
current_pos = p+1;
};
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
};
};
};
slideLink.onRelease = function(){
getURL(propLink[p]);
};
... and the small bit of code inside the LED buttons...
PHP Code:
var thisLed:Number = this._name;
this.onRollOver = function(){
this._alpha = 100;
};
this.onRollOut = function(){
this._alpha = 0;
};
this.onRelease = function(){
var lastLed:String = (_root.p);
_root.loadingClock._alpha = 100;
this._alpha = 100;
clearInterval(_root.myInterval);
_root.p = (thisLed - 1);
_root.nextImage();
};
//// RUNTIME START ////
this._alpha = 0;
_root.loadingClock._alpha = 0;
Whatever help you can give me on either of these would be greatly appreciated.
Thanks.
Slideshow With Alt Text
Hi.
I had tried to make a slideshow with some alt text, so when you make a mouseover on one of the thumbnails it will show an alt text for the thumbnail.
The problem is that when I try to run the movie I can make a mouseover but it keeps running and don't stop when I take the cursor away from the thumbnail(s).
The .fla file is here:
http://www.x-itin.dk/Slideshow.zip
Someone had told me that the mouseover action on the panel _mc is the problem and "overwrite" the mouseover function in the _mcs in the panel _mc.
Can someone give me a solution on that problem?
Text On Image Slideshow
ok i have another question:
i have like a slide show of images now from a tutorial i used.
if i want text to overlay each image and not fade in or out (like the images do) how do i do this?
again thanks in advance.
Looping Slideshow Text
Ok, I've been trying all day but I can't seem to get the text to loop the right way. After it plays once, "FIVE" stays on stage and as it continues to play the rest stack on top. For some reason trace(eval('txtholder'+oldid)); returns undefined on the first frame every time it loops.
I tried many things including this last effort but it still stacked:
if (id == 0) {
_root.txtholder4.play();
trace("id = 0");
} else {
var oldid:Number = id-1;
eval('txtholder'+oldid).play();
trace("id != 0");
}
Attach Code
#include "com/unwork/tween.as"
stop();
var txtArray:Array = ["ONE", "two", "THREE", "four", "FIVE"];
// Text
switchTxt = function (id) {
this.attachMovie('txtholder','txtholder'+id,this.getNextHighestDepth());
eval('txtholder'+id).txtdisplay = txtArray[id];
var oldid:Number = id-1;
eval('txtholder'+oldid).play();
trace(eval('txtholder'+oldid));
};
// Slideshow
var data:Array = ["images/homesplit/chris.jpg", "images/homesplit/karli.jpg", "images/homesplit/joan.jpg", "images/homesplit/dorian.jpg", "images/homesplit/sharlynn.jpg"];
// assign dataProvider
slider1.dataProvider = data;
// set the effect transition duration
slider1.duration = 1200;
// start slideshow (timeout between images, repeat images)
slider1.start(900,true);
// listeners
var mainListener:Object = new Object();
slider1.addListener(mainListener);
// dispatched when a new transition is being played
mainListener.transitionInStart = function(target:MovieClip) {
trace('transitionInStart: '+target._name+', index: '+target.selectedIndex);
switchTxt(target.selectedIndex);
};
// dispatched when slideshow has completed
// only then repeat is set to false
mainListener.finish = function(target:MovieClip) {
trace('finish: '+target._name);
};
Xml Slideshow- Trying To Add Another Swf Instead Of Description Text
I'm trying to add a scrolling .swf for the "description" but it's not working, can anyone help me? I got the scroller itself to work fine but can't figure out how to integrate it into the xml thumbnail file.
The xml thumbnail album flash file is here
...and the scroller swfs that link to the text docs below are here and here.
studiotext1.txt
studiotext2.txt
Oh, here's the studio.xml file! <?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>images/0.jpg</image>
<thumbnails>images/thumbs/wickham.swf</thumbnails>
<caption>An Inspired Beginning</caption>
<desc>studiotext1.swf</desc>
</pic>
<pic>
<image>images/1.jpg</image>
<thumbnails>images/thumbs/henry.swf</thumbnails>
<caption>Influence of Era and Place</caption>
<desc>studiotext2.swf</desc>
</pic>
</images>
Any help with this would be GREATLY APPRECIATED I have been trying to figure this out forever!
Adding Text To Flash Slideshow?
Hello everyone,
I am trying to achieve this effect shown here:
http://www.kh-2.net/banner.swf
For the image background transition, I have used this tutorial:
http://www.whatdoiknow.org/archives/001629.shtml
I have managed to make a "writing text effect", and it is one of the layers over the one with the background transition in Flash MX. However, The text immediately disappears when the first image in the slideshow appears. What I want is a static text that stays there the whole time, like the example above. Does anyone have any idea how to do this?
Text Slideshow - Help With Creating Increments
Hello,
I am creating a random text slideshow from an XML document. The XML document includes a list of Band and Artist names. I need to randomize/shuffle the band/artist names and display them one by one like a slideshow. However, after three band/artist names have been listed, I need to display a static tag line. This process needs to repeat indefinetly. So for example, my slide show would display like so:
AC/DC, OutKast, Bruce Springsteen, We Play Everything, Ozzy Osbourne, Phil Collins, U2, We Play Everything,........
I have been able to do the following:
- Load the XML document
- Loop through the XML document
- Create an array of Band/Artist names
- Shuffle the array
I am now stuck on the following:
- Creating the loop to cycle through three names
- How to add the static tag line
- Repeating the loop, but starting on the next three band/artist names in the array
The last thing I have to do which I have a slight idea on how to achieve is the following:
- use setInterval to display the band/artist names in a dynamic text field.
Without further delay, here is my current AS:
Code:
artist_xml = new XML();
artist_xml.ignoreWhite = true;
artist_xml.onLoad = function(sucess) {
if (sucess) {
processArtist(artist_xml);
}
};
artist_xml.load('artist.xml');
function processArtist(xmlDoc_xml) {
var len = xmlDoc_xml.firstChild.childNodes.length;
var artistArray = new Array;
for (var n = 0; n<len; n++) {
artistArray.push(xmlDoc_xml.firstChild.childNodes[n].firstChild.firstChild.nodeValue);
}
Array.prototype.shuffle = function() {
for (var n=0; n < len; n++) {
var rand = Math.floor(Math.random()*len);
var temp = this[n];
this[n] = this[rand];
this[rand] = temp;
}
}
artistArray.shuffle();
//From here, I'm not sure on what to do. While the code below does work,
//it ultimately is not the desired result (this only works for the first three
//names, and does not cycle through the entire array
i = 0;
while(i++ < 3) {
trace("Bob Plays " + artistArray[i]);
}
}
With that, does anyone have ideas on how I can achieve the rest of my project?
MovieClip Slideshow+XML W Dynamic Text
http://i61.photobucket.com/albums/h7...deShowinMC.jpg
Anyhelp anyone? This is the closest thread I came to achiving this..
http://www.gotoandlearn.com/forum/vi...asc&highlight=
but no fla to see visuals while creating in the process..
any help?
Text Label Not Working In My Slideshow?
NEVERMIND! somehow the font color had gotten changed and the words just weren't showing up, but they were there. Sorry.
I have a global string variable assigned in one place and then it's supposed to be the label for a textfield on the next four slides.
It works fine on the first slide, but after that it stopped working.
Code:
on(reveal){
trace(student1.text + " " + student_name);
student1.text = student_name;
trace(student1.text + " " + student_name);
}
The first trace puts out nothing for this.student1.text and the correct string for the global variable student_name.
The second puts out the correct text for both.
(The thing that's confusing me is that the previous slide has the exact same code and is working properly. . .??)
Any hints? Thanks.
Random Loading Text From XML Slideshow
Hi!
I'm trying to load text into a dynamic text box from an external XML. My XML "test.XML" looks like this:
HTML Code:
<?xml version="1.0" standalone="yes"?>
<root>
<item>
<author>Namer Last</author>
<content>Blah bla bla bla bla bla.</content>
</item>
</root>
And I have two dynamic text boxes on my stage; one named "author_txt" the other named "content_txt"
Here is AS:
ActionScript Code:
var xmlFlash_xml:XML = new XML();
xmlFlash_xml.ignoreWhite = true;
xmlFlash_xml.onLoad = doit();
function doit(success) {
//onLoad event is triggered when the XML document hasbeen entirely loaded
if (success) {
trace('success');
// success is true if the XMl has been loaded with no errors, and false else
var l = this.firstChild.childNodes.length;
// firstChild property represents the rootnode of the XML document, childNodes property returns an array containing the children nodes of the current node. So, l variable holds the number of children of the root node
var c = Math.floor(Math.random()*l);
author_txt.text = this.firstChild.childNodes[c].childNodes[0].childNodes[0].nodeValue;
content_txt.text = this.firstChild.childNodes[c].childNodes[1].childNodes[0].nodeValue;
}
else {
trace("fail");
}
};
xmlFlash_xml.load("test.xml");
It fails to load. Any idea why?
Thanks!
Dynamic Text From An External Text File. Issue
hi,
a small one, i think(?)
i have a dynamic text field in my site, loading txt from an external txt file.
the problem i am having is that when the text field comes is loaded onto the
stage, before the text is displayed tehre is a delay and the text box displays the target pathe to the text box instead of the loaded text. After a few seconds the text loads and everything is fine.
Is there a way to stop this, either displaying an empty box until it loads, or should i be loading all the text into the text files on the first frame of the movie before they are displayed.(?) am i approaching the problem from the wrong angle maybe.
Thanks very much
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...
Specifying Thumbs
Hey, does anyone know how to get thumbnail images to load individual pictures? I've got my thumb pictures loaded from a for loop but after that I don't know how to "talk" to each thumb and get it to load their individual picture? Does anyone have any pointers?
ActionScript Code:
this.createEmptyMovieClip("container", 1);
container._x = 0;
container._y = -300;
function initClips(){
var imageNumbers:Number = 9;
for (i=1; i<=imageNumbers; i++){
container.attachMovie("img", "img"+i, i); //attach the movie
myThumb_mc = container["img"+i];
myThumb_mc._x = (i-1)*myThumb_mc._width;
myThumb_mc._y = (Stage.height-myThumb_mc._height)/2
myMCL.loadClip("img/thumb" + i + ".jpg", container["img"+i], i);//loads images into clip
}
}
Specifying Thumbs
Hey, Can anyone help me? I'm trying to get each of my thumbs to load an individual picture but I can't seem to get it working. I have this script that has a trace for each thumb but I don't know how to actually get the thumb images to load individual pictures.
I've tried using:
img1.onRelease = function() {
as a way of talking to each of my thumb pictures but it doesn't work. If anyone can help I would greatly appreciate it.
this.createEmptyMovieClip("container", 1);
container._x = 0;
container._y = 0;
function initClips()
{
var imageNumbers:Number = 9;
for (var i=1; i<=imageNumbers; i++)
{
container.attachMovie("img", "img"+i, i);
myThumb_mc = container["img"+i];
myThumb_mc._x = (i-1) * myThumb_mc._width;
myThumb_mc._y = (Stage.height - myThumb_mc._height)/2;
myMCL.loadClip("img/thumb" + i + ".jpg", container["img"+i], i);//load images into clip
// Give each thumb a name property.
// Use this name to load the full size image
myThumb_mc._name = "img" + i;
// Use an onRelease handler on each thumb to call a function
myThumb_mc.onRelease = showFullImage;
}
}
// Use this function to load the full size image
function showFullImage()
{
var full_image = this._name;
trace(full_image);
myMCL.loadClip("image1.jpg", imgCon, i);
}
// Place your load movie routine here
}
initClips();
Photo Slideshow With XML - Image Gap On First Cylce Through Slideshow
Hello,
I am new to this site, and I went through the tutorial on this site, "Photo slideshow using XMl and Flash, " http://www.kirupa.com/developer/mx20..._slideshow.htm
but I encountered a problem where my images lag the first time they cycle through all the images in the XML file.
The first time the flash page loads and starts the slideshow, I don't want the gap between the transitioning of the images where the movie backgound shows. I think it has something to do with the images loading for the first time, so I tried to load each picture in a different movieclip with an alpha of 0 before the slideshows starts, but it didn't work and there is still the gap between the images the first time the pictures cycle through the slide show.
Please offer any advice on how to stop the image lag the first time the slideshow cycle through all the images in the XML file.
Urgent Help....They're Going To Take My Thumbs
Hello everyone,
I was wondering if it is possible to preload external .swfs.....and then play them in a different scene.
Im making an ecard....I have 4 scenes.
1.) Preloader
2.) E-card
3.) Name
4.) Age
The Name and Age scenes involve sound files that are loaded from an external .swf.
I want them to load straight away, so I need them to be preloaded in the preloader scene.
Is it possible....Please help me!!!
Or if it is not possible can anyone think of a cheater way to accomplish this.
Thanks.
Preload JPG Thumbs
is there a way for me to pre load multiple jpgs at the same time on the screen.
I would like each of them to show % loaded.
I am lost here, any help would be great.
Scrolling Thumbs Row By Row
I have a thumbnail grid, 5 columns and X rows, with 2 rows shown each time, the rest is masked.
i would like to make a scroller that onRelease moves down one row at a time, but I can't figure out how to do it
if possible i would love to do it with the tween class.
Thumbs height is 50px, and spacing between rows 5px.
thanks for the help
ps: sorry i accidentally posted in the wrong section...if you could please move to actionscript
Thumbs Down On Scenes - Now What?
So I searched here on why scenes shouldn't be used... ok I will give them up reluctantly. The advise I saw said to publish each scene into separate .swf files. Ok but then what? How to I call up the scenes in the main movie? FYI - the yet to be created movie in question will NOT be on the web - its a huge video presentation. And talk to me like I'm an idiot 'cuz I am one - can you paste in the script here that would explain how to do this???
(Using CS3 and AS2)
Many tanks!
Thumbs Width (the FWA)
How can I create an resizing effect similar to the one on http://www.thefwa.com/
When you resize the screen, thumbnails start to get seperate from each other, till they get a new one near them.
[as2]last Added Thumbs
Hi i want to add on my site sth like - last added pictures. Ive got a folder with some jpg's - normal size called 1.jpg 2.jpg etc. and thumbs - 1_th.jpg 2_th.jpg etc. I want to show only last added thumbs, not original size. I dont want to link thumbs with normal sized pics or sth. This should be in one column - last, 5 added thumbs. I know that I should use createEmptyMovieclip to create 5 container mc's. And next I should load last added thumbs. but now ive got a problem. I really dont know how to do that. Because it must depend on date of adding the file. Im also using a gallery based on xml. here its his structure:
Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>pics/1.jpg</image>
<thumbnail>pics/1_th.jpg</thumbnail>
<title>Obrazek nr 1</title>
<caption>Opis</caption>
<url>pics/big_1.jpg</url>
</pic>
<pic>
<image>pics/2.jpg</image>
<thumbnail>pics/2_th.jpg</thumbnail>
<title>Obrazek nr 2</title>
<caption>Opis</caption>
<url>pics/big_2.jpg</url>
</pic>
<pic>
<image>pics/3.jpg</image>
<thumbnail>pics/1_th.jpg</thumbnail>
<title>Obrazek nr 3</title>
<caption>Opis</caption>
<url>pics/big_3.jpg</url>
</pic>
<pic>
<image>pics/4.jpg</image>
<thumbnail>pics/2_th.jpg</thumbnail>
<title>Obrazek nr 4</title>
<caption>Opis</caption>
<url>pics/big_4.jpg</url>
</pic>
</images>
maybe i could use this file to solve my problem? for example script will read from file last 5 <thumbnail></thumbnail>? but im not good at as so maybe you could help me?
Fingers And THUMBS
I developed a site for a friend www.stujacksonphotography.com
The problem is he has returned from another Photo shoot and wants to add more sets to the gallery. Well thats fine, and I can do it the same way as before, which was to manually add them to the flash file. But I want to be able to have the architecture of the site to be more dynamic.
I want to be able to use a MySQL database to add the title of the image, a thumbnail and a full size image.
I want the flash movie to read the database and parse them into the movie.
What is the best way of doing this?
Many thanks in advance.
|