Copy link to clipboard
Copied
Hi,
I'm working on a photography website. I've created event listeners for buttons that allow people to jump between keyframes with images.
I also want to add functionality to go back to the first frame. I've created a button (used a component), gave it an instance name (home_btn) and created code like that:
home_btn.addEventListener(MouseEvent.CLICK, goHome);
function goHome(Event:MouseEvent):void
{
gotoAndStop(1);
}
It doesn't give me any error message but when I run it and click on the button, nothing happens...
Copy link to clipboard
Copied
probably you go to first frame in different timeline. you can got to first frame of main taimeline in this way: MovieClip( this.root ).gotoAndStop( 1 );
Copy link to clipboard
Copied
Thanks for your answer. It looks a bit more complicated than I thought. Why gotoAndStop(1) wouldn't work?
Copy link to clipboard
Copied
Each movie clip have own timeline. Methods for navigation ( like gotoAnd.... ) work for this time line. If you wont to controll different timeline you must address it. I'm not sure what kind of problem you have. It may be that maintimeline have only one frame and you are on it ( in this case gotoAndStop() do nothing ) and the clip with gallery is no that frame. In this case the solution is to address timeline of that clip.( if clip is named 'mcGallery' than it can be controller like this: mcGallery.gotoAndStop( 1 );
Copy link to clipboard
Copied
I've got everything on one timeline. There are keyframes on frames 10, 20, 30, 40, 50 ,60 with big previews of images and a set of buttons linking to these frames.
I wanted to add another button that would go to frame 1 (there is an introductory text on frame 1 that disappears when you go to other frames with images).