Google Answers Logo
View Question
 
Q: Scrolling Dynamic Flash Content ( No Answer,   0 Comments )
Question  
Subject: Scrolling Dynamic Flash Content
Category: Computers > Programming
Asked by: track23-ga
List Price: $60.00
Posted: 14 Nov 2006 16:29 PST
Expires: 14 Dec 2006 16:29 PST
Question ID: 782782
I am making a Flash web site for a client and they want it easy to add
or subtract or change case study files. Consequently, I am dynamically
loading external thumbnails for each one so that all they have to do
is drop a new thumbnail image into the directory and it will show up
in the SWF movie on their site.

My problem is scrolling the thumbnails. I have it working for sixteen
of them, but don't know how to code it so that it will work with a
different number. Following is the actionscript code I am using. It
seems to be a math issue that I can't quite grasp.

For the thumbnail container movie frame:
(For this example I've specified a fixed number for the
caseStudiesTotal variable. In the actual working situation, this
variable would be the number of thumbnails in the directory.)

[code]
onClipEvent (enterFrame)
{
	var caseStudiesTotal = 16;
	// _root.slider refers to the draggable button
	yn = -_root.slider._x * (caseStudiesTotal * 0.05109375);
	// The number 0.05109375 is used because that results in the number
	// 0.8175 when multiplied by 16. I don't know why this works, but it
	//does.
	setProperty("", _x, (_x + 2.0) - (((_x - yn) * 0.8) * 0.3));
}
[/code]

For the draggable slider button frame:

[code]
this.onPress = function () {
    startDrag ("", false, 10, 438, 653, 438);
}
this.onRelease = this.onReleaseOutside = function () {
    stopDrag ();
}
[/code]

(You shouldn't need the second code snippet, but I've included it just in case.)

The whole Flash movie is 730 x 558 pixels and the thumbnails scroll
horizontally across the entire 730 pixels, with 9 pixels of padding
between each one and on either end. Each thumbnail image is 69 pixels
wide. The width of the scrollbar area is 643 pixels.

See this graphic:
http://www.toddlininger.com/thumbscroll.gif

It's easy to get the total width of the thumbnail container
[#_of_thumbs * (69 + 9) + 9]; now I need the proper code (preferably
easy to understand) to scroll it based on the width of the thumbnail
container and the scrollbar.

Please let me know if you need any clarification. Thank you in advance
for your help.

Clarification of Question by track23-ga on 14 Nov 2006 16:41 PST
I should mention that the client has to keep at least 10 thumbnails
active so that they will fill the entire horizontal space of the
movie. So you don't have to worry about having fewer than 10
thumbnails.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy