Hey guys,
Meet my new app- a WIP flash site that builds it’s nav and content from a DB:
http://www.chrisdidthis.com/warnerphoto/warnerphoto.html
I’ve set up a slideshow that runs in loop- it’s not very elegant at the moment, but before I go on working to refine it’s functionality, i’ve run into a problem-
I’m pulling values for my image names from an array of names- I have a value( i ) that increments up and determines the array index to pull the infromation from. This value resets to 0 when it reaches the end of the array and starts from zero again.
Everything works perfectly the first time that *i *is climbing towards it’s reset value, however, when i reset it back to 0, the array stops returning values for *images_array- it returns undefined for my image names. If you view the link above, you’ll see that the slideshow just stops after it’s cycled through all the images. = |
I’m totally stuck on this one, anyone heard of this before? I’ve pasted in my code here, highlighting the important (i.e not working) bits in black.
Thanks in advance everyone
[COLOR=Silver]++counter;
if (counter == frequency) {
counter = 0;
++loader_depth;
loader_name = “loader_”+i;
trace ("changing image, array length = “+images_array.length+”, i = "+i);
[COLOR=Black] duplicateMovieClip (image_loader_mc, loader_name, loader_depth);
this[loader_name].image_name = images_array*;
//
[/COLOR][COLOR=Black] if ((i+1) == images_array.length) {
i = 0;
}
++i;[/COLOR]
}
gotoAndPlay (2);[/COLOR]
Also, here are my image creation lines that happen a few frames previously- just in case
[COLOR=Silver]
[COLOR=Black]images_array = new Array ();[/COLOR]
var frequency:Number = 90;
var counter:Number = frequency - 5;
[COLOR=Black]var i:Number = 0;[/COLOR]
var loader_depth:Number = 1[/COLOR]