|
-
Sliding image (or text) gallery
Hi all!
I'm trying to find some code that will allow a large movieclip to "scroll" and hit certain specific points depending on what link or thumbnail is clicked. I'm having real trouble articulating what I'm thinking, so I created a quick (non-functional, playing only) demonstration here:
http://aenow.com/helpdesk/Example1.html
In the example above, I have four 500px-wide photos in one 2000px-wide horizontal movieclip. If a user is viewing the first image, and clicks the third image thumbnail, I'd like the movieclip to smoothly move from position 0,0 to position 1000,0, thereby showing the third image (but passing over the second image to get there.) Or, if they're on the fourth image, and click the first image thumbnail, I'd like the movieclip to smoothly move back from position 1500,0 to 0,0 (passing over the third and second images to get there). Does that make sense? Nothing has to load dynamically, but it does have to be AS2.
Any ideas would be very helpful!!
-
Pretty please ?
-
Should I offer money ?
-
//four 500px-wide photos in one 2000px-wide horizontal movieclip -- instance name 'contentMC', registration point upper left corner
// four thumbnails -- instance names 'btn1', 'btn2', 'btn3', 'btn4'
Code:
// code on main timeline
import mx.transitions.Tween;
import mx.transitions.easing.*;
stop();
btn1.endX = 0;
btn1.onPress = doPress;
btn2.endX = -500;
btn2.onPress = doPress;
btn3.endX = -1000;
btn3.onPress = doPress;
btn4.endX = -1500;
btn4.onPress = doPress;
function doPress() {
var twX = new Tween(contentMC, "_x", Strong.easeInOut, contentMC._x, this.endX, 1.5, true);
}
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|