Link to home
Start Free TrialLog in
Avatar of Oneiroid
Oneiroid

asked on

Help controlling dynamically created buttons and movieclips -- file attached

I am trying to create a 'paging' function for my gallery, where 'pages' of thumnail links are displayed instead of, say, a scrolling thumnail menu. These pages are controlled by page buttons below. All are created dynamically.

The first page of thumbs appears correctly. But the subsequent pages do not. I have trace calls throughout the code that you can uncomment to help. The currently uncommented trace calls seem to me to indicate that the code should operate correctly (or not...).

I've been staring at the code for a long time, and I think I need another set of eyes now. I don't know if this is a depth problem or what it is.

Here is the fla and associated files:
http://65.36.238.78/fla/gallery.zip

If I can provide any additional information, please ask. Thanks!
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Oneiroid
Oneiroid

ASKER

I tried pulling out the page-create into a function, and included a trace to be sure that is was being hit predictably. The pages appear to be getting created.

But building a page every time a button is clicked seems a little less effecient than the current apprach, no?

Something else to consider here, is that the first page appears, but after navigating to the other pages which do not appear, the first page will not reappear. Hmmm...
Okay... found something. It seems that the alpha value of the thumb buttons is causing grief. For example, if you start all of the buttons at alpha value 100 (do not alter the visibility), and remove the two lines of alpha manipulation in the newPage function, it appears to work.

However, I'd very much like to also control the alpha.

Anyway, I think this might be on the right track...
Another interesting test...

Set all the alphas back to their original state (as in before my last post), and  in the 'loop current page images to disappear' loop (the first loop in the newPage function), set the alphs value tp 15 instead of 0.

Run the script. The first page shows up. The second page does not show up. The third page does not show up. But on any page button you click on thereafter, the pages show up as they should, but only with an _alpha of 15.

Curious.
what i did last night before i got sleepy, was create each "page" with an x and y offset - and from what i could see, only 1 page was being created.
my theory is this.
load up the xml store everything, calculate how many pages, how many thumbnails etc.
create the first page thumbnails.
load images into the thumbnails.
then when they do a Nextpage - check the number required (clear the extras if necessary) load the next lot of images.
i tried stripping out all the extra code last night (the zoomy stuff) to get that part working, but sleep got the better of me.
if i find something will let you know.

what happened to that last file we had where it loaded, then went wonky. i've tossed mine.
In the original file, I managed to fix a depth conflict between the thumbnails and the main image viewer. It appears that I got this new file working now - the main culpret was an alpha mis-assignment. I got it working with both the no-fade version and the fade version (which was commented out), and both had their problems.

Thanks for taking a peak at my files. I will certainly consider the page creation/navigation method you described in your last post the next time I need this kind of functionality.

Cheers.
Hey, collaborative troubleshooting is still worth an 'A'. Thanks again!