473,425 Members | 1,763 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

need help adding thumbnails and scroll buttons

anfetienne
424 256MB
ive been through a tutorial on using array for a gallery and wrote the following code.

i need to include thumbnails with left and right buttons on each side to scroll through the thumbnails

MY CODE
Expand|Select|Wrap|Line Numbers
  1. #include "64516994.txt"
  2.  
  3. this.fadeSpeed = 20;
  4. this.pIndex = 0;
  5.  
  6. loadMovie(this.locVar[0], _root.photo);
  7. MovieClip.prototype.changePhoto = function(d) {
  8.     // make sure pIndex falls within pArray.length
  9.     this.pIndex = (this.pIndex+d)%this.locVar.length;
  10.     if (this.pIndex<0) {
  11.         this.pIndex += this.locVar.length;
  12.     }
  13.     this.onEnterFrame = fadeOut;
  14. };
  15. MovieClip.prototype.fadeOut = function() {
  16.     if (this.photo._alpha>this.fadeSpeed) {
  17.         this.photo._alpha -= this.fadeSpeed;
  18.     } else {
  19.         this.loadPhoto();
  20.     }
  21. };
  22. MovieClip.prototype.loadPhoto = function() {
  23.  
  24.     var p = _root.photo;
  25.  
  26.     p._alpha = 0;
  27.     p.loadMovie(this.locVar[this.pIndex]);
  28.     this.onEnterFrame = loadMeter;
  29. };
  30. MovieClip.prototype.loadMeter = function() {
  31.     var i, l, t;
  32.     l = this.photo.getBytesLoaded();
  33.     t = this.photo.getBytesTotal();
  34.     if (t>0 && t == l) {
  35.         this.onEnterFrame = fadeIn;
  36.     } else {
  37.         trace(l/t);
  38.     }
  39. };
  40. MovieClip.prototype.fadeIn = function() {
  41.     if (this.photo._alpha<100-this.fadeSpeed) {
  42.         this.photo._alpha += this.fadeSpeed;
  43.     } else {
  44.         this.photo._alpha = 100;
  45.         this.onEnterFrame = null;
  46.     }
  47. };
  48. // Actions -----------------------------------------
  49. // these aren't necessary, just an example implementation
  50. this.onKeyDown = function() {
  51.     if (Key.getCode() == Key.LEFT) {
  52.         this.changePhoto(-1);
  53.     } else if (Key.getCode() == Key.RIGHT) {
  54.         this.changePhoto(1);
  55.     }
  56. };
  57. Key.addListener(this);
  58.  
i have attached the fla that i would like my gallery to be similar to....if there are tutorials that can help please do tell.
Attached Files
File Type: zip gallery.zip (19.4 KB, 102 views)
Jul 24 '09 #1
0 1661

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Jonathan | last post by:
I'm trying to build a scrollable div with "up" and "down" buttons to replicate the action of a scroll bar. The reason I'm not just using "overflow:auto" is because I want to position the scroll...
2
by: Joshua Moore | last post by:
Is there any way to have buttons scroll up and down on a standard textbox? The touchscreen we're using doesn't work very well on scroll bars, so I'd like to create buttons to immitate the Page Up /...
12
by: Jim H | last post by:
I have a ListBox hold a list of my custom controls (it's UserControl based control with a couple radio buttons and a checkbox). Everything works and displays the way I expected it to. I can move...
0
by: memanwar | last post by:
Throughout our system we use the DataGrid. One problem we've noticed is that the arrow buttons don't always work with our grids, clicking on them sometimes won't move the columns at all, or may...
2
by: ranger7419 | last post by:
I'm trying to figure out why this script will work in IE 6 but not Firefox, and so I need someone here with a far better grasp on javascript to explain this. Basically, I have a page with several...
0
by: nevada17 | last post by:
My goal is to find a way to apply scroll bars across the y axis of about 25 check buttons so that my interface isn't too large. I've read about scroll bars and I realize that's its not possible to...
4
by: Michael R | last post by:
Hello. I would like to replace the defalt Scroll Bars with custom buttons in a continuous form. I've tryed to make command buttons with the goto next/previous record macros, but those aren't...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.