This content has been marked as final. Show 12 replies
Not sure, but this might work
that did not work... anyone else?
Sorry, but its a bit hard to guess what's causing the problem... based on what I see of your code, in principle that type of approach should work. But it depends on all other assumptions I made about what your code does being correct.
I assumed int() is a something like Math.floor() or Math.round()
I assumed that thumbs_line has no transformations (e.g. scale) on it, and neither has thumbs inside it, if its on the timeline at authoring time. perhaps you should substitute:
Here is my source file:
myFiles.zip - Click here to download
FYI: wedding and multimedia FLA are reading from different XML files, but both XML files are reading from the swf_multimedia directory (I just made weddings.fla read less)
Main focus is Line 148 in the code (and lines surrounding)
controls._x = int(sectionTitle._width+(thumbs_line.thumbs['thumb'+(t-1)]._x));
My original approach seems to work... although I didn't play around with the number of images.
Like I said the 5 was arbitrary... changing it to 25 worked for me. (I only tried it with one of your flas)
I see. and when I went from multimedia.FLA to wedding.FLA, it did not work until I change it from 25 to 100. I think what i'm trying to get at is somehow take the controls based on the width of the
section title + the dynamic number of thumbnails + some space (thumbs_space).
The whole thing I'm trying to get at is, if I add/delete a certain amount of photos I want to stay out of the FLA.
I'm wondering if there's a way to write a variable for thumbs_width within the XML file, so that I dont have to keep manipulating the FLA. What are your thoughts? do you know how to do this?width of the section title + the dynamic number of thumbnails + some space (thumbs_space).
What you're seeking to do is perfectly do-able and it would make sense not to have to code it in the xml. If I get some time later on to look in more detail I will. Sorry I can't solve it now. Someone else might beat me to it...
I appreciate your efforts, and to those who may see this, you are more than welcome to browse through this thread and help me out with the last couple of replies.
GWD: I hope to see something later, shoot me your e-mail so I can say a big thank you! :) My E-mail
Don't know if you already sorted this out, but here's one way to do it. I think part of it could be a timing issue with the loading of the thumbs, and using width calculations before the thumbs are loaded. This might seem to work sometimes with constant offsets but won't if the thumbs widths are different for different xml files. So I put the control placement code in the thumb loader onLoadInit handler, where it should have access to the actual values based on most recently loaded thumb image. But I must confess I didn't dig too deep in terms of trying to understand it or test it thoroughly. As soon as I got it working the way it should I stopped!
Here's the instructions for changes. Do them in order so the line references are the same. Please note this is off the line numbers as posted in your zip file versions. If you made changes since then, you should refer to the versions in the zip file for the correct line number references. Good luck.
You could try this (a simple approach but it may work:
controls._x = (thumbs_line._x + thumbs_line._width);
@barryels : I started off thinking along similar lines, but its difficult to interpret the structure/hierachy without looking at the full context of the code and design. That won't work here because in the fla the thumbs_line clip spans the whole display.
thumbs is inside thumbs_line and it is the clip that actually holds the thumb image clips. I moved thumbs across inside the thumbs_line clip and did basically the same thing that you describe, but using thumbs instead of thumbs_line. And also delayed the control placement until the most recent thumb had loaded.
GWD: Greg, ignore my e-mail, it didnt break it. However, I want the controls snug with the last dynamic image on the right. Your controls default all the way to the right. I was hoping to control the ._x based on how many thumbnails there are...