Skip to main content
Participant
May 12, 2009
Question

need help with forward/reverse animation depending on playhead position

  • May 12, 2009
  • 2 replies
  • 1096 views

I'm trying to create a side-scrolling image gallery, with a series of thumbnails at the top that will take you to their corresponding full size images. I've been able to make them link to the correct frames, and able to animate the scrolling going in one direction, but the scrolling in reverse is presenting a challenge. It might be an easy fix, it might not.

Basically, in my non-AS3 literate mind, the way I imagine it would work is I'll have animations in my timeline corresponding to forward and reverse, and depending on what frame the playhead is on when a user clicks the thumbnail, it will play a certain portion of one animation or the other. So how would I accomplish this? A series of 'if' and 'then' commands?

I don't know the syntax (yet). If anyone has been down this road before and can give me some guidance, I'd sure appreciate it.

Thanks!

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
May 12, 2009

If you are not up to taking on a coded approach, then I won't try to push it, though it might be the simpler to manage and wouldn't require any timeline animation.  Can you explain how you currently manage making the thumbnails tell the images to animate?  What code do you use and what is the general scenario.

joefinkelAuthor
Participant
May 12, 2009

here's the script, which i've got assigned to the first frame of the layer titled 'actions'. this script works fine in advancing forward through the timeline, but once you go from frame 30 to the third thumbnail - well you can see here, it plays the frames between the second and third keyframes.

thumb01.addEventListener(MouseEvent.CLICK, thumb01Function);

function thumb01Function(event: MouseEvent) {

gotoAndStop(1);}

thumb02.addEventListener(MouseEvent.CLICK, thumb02Function);

function thumb02Function(event: MouseEvent) {

gotoAndPlay(2);}

thumb03.addEventListener(MouseEvent.CLICK, thumb03Function);

function thumb03Function(event: MouseEvent) {

gotoAndPlay(7);}

thumb04.addEventListener(MouseEvent.CLICK, thumb04Function);

function thumb04Function(event: MouseEvent) {

gotoAndPlay(12);}

thumb05.addEventListener(MouseEvent.CLICK, thumb05Function);

function thumb05Function(event: MouseEvent) {

gotoAndPlay(17);}

thumb06.addEventListener(MouseEvent.CLICK, thumb06Function);

function thumb06Function(event: MouseEvent) {

gotoAndPlay(26);}

Ned Murphy
Legend
May 12, 2009

I don't see what you mean as far as heading from frame 30.  My guess is you expect people to move from one button to the next sequencially, if they don't, you probably won't like what they see.

You will be much better off taking a coded approach than a timeline approach.  I realize coding is probably unknown and preferably avoided as a result, but it really isn't that bad when you take the time to work thru it... and after all, this is an actionscript forum.

kglad
Community Expert
Community Expert
May 12, 2009

that's probably going to be a mess.

it would easier to use actionsript to control your thumbnail scrolling.  you can check any number of tutorials (use google to search) about how to make scrolling thumbnails.

joefinkelAuthor
Participant
May 12, 2009

i've seen a number of galleries with scrolling thumbnails, but that's not what i'm looking for. i want the thumbnails to be static and the full size images to scroll, based on which thumbnails are clicked. it sounds simple in my mind, is there really no simple way to do this?