Solved

Help controlling dynamically created buttons and movieclips -- file attached

Posted on 2008-10-10
7
182 Views
Last Modified: 2013-11-11
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!
0
Comment
Question by:Oneiroid
  • 5
  • 2
7 Comments
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 22703573
hey me again.
i just looked through your code again.
i need to head off to a class in a few minutes, but it seems to me the other "pages"  are never getting created.
instead of creating pages - what you need to do is strip out the attach clip in a separate function.
then call each "build page" function when they click the buttons.
i'll see if i can have a look tonight when i get home from class.
but think about what i said.
0
 
LVL 4

Author Comment

by:Oneiroid
ID: 22705795
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...
0
 
LVL 4

Author Comment

by:Oneiroid
ID: 22707495
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...
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 4

Author Comment

by:Oneiroid
ID: 22707664
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.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 22708633
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.
0
 
LVL 4

Author Comment

by:Oneiroid
ID: 22716305
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.
0
 
LVL 4

Author Closing Comment

by:Oneiroid
ID: 31505168
Hey, collaborative troubleshooting is still worth an 'A'. Thanks again!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question