Hi, I'm almost done with this Photo Gallery project but I
have one final issue with the photo gallery. I created a
multidimensional array to group image paths from the XML file in
sets of 9. When the array is called the images appear in the right
order, but when the images are rendered in their respective movie
clips dynamically they appear in reverse order. Why would this be
happening? I don't want to use the array.reverse() method because
it would complicate my code unnecessarily when I add forward and
back buttons to navigate throught the different sets. Any help
would be greatly appreciated.
From the help docs:
The MovieClipLoader.onLoadInit handler is invoked after the
actions in the first frame of the clip have executed, so you can
begin manipulating the loaded clip.
The problem is the way the onLoadInit function fires. Since
it doesn't fire until after the onLoadComplete method, you have a
call stack of 9 onLoadInits waiting to fire. Since it uses a stack
structure, your data is handled in a first-in-last-out format,
hence, the first image in is the last image out.
You can fix the behaviour by changing onLoadInit to