using buttons to go to a frame number

Posted on 2012-09-05
Last Modified: 2012-09-06
I'm using Flash 5.0 action script 3. I have three movies.

On the main timeline, frame 1 has stop(); to stop the main timeline movie before it plays.

Frame 2, 3 and 4 each has a movie clip.

I want to use button clicks of buttons 1,2, and 3 to each go to a different frame and stop there and play the movie clip in that frame without going to the next frame of the main timeline.

The buttons are all on the main timeline.

On my action script layer in the main timeline, I am using this

button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void

It does nothing.

I've tested each of my movie clips and they all work, but they don't seem to play when I use the button click to go to the frame the movie clip is on and stop or stay on that frame.

I can't use gotoAndPlay because that will continue along the main timeline.

I would attach the fla file, but EE doesn't like that and instead they replace the fla file extension with xfl and then tells me it's not in the allowed file extension list. Not the first time I've had this problem with their attachment policies. I've tried renaming to .txt, but its still the same weird block where it changes the file extension to xfl and then rejects it
Question by:BobHavertyComh
    LVL 39

    Expert Comment

    your code as is should work if you've set it up as I understand it.

    does your timeline go to frame 2?

    does this function get triggered?

    try using to upload your file alternatively go to your publish settings and deselect  include xmp metadata and try again.
    LVL 9

    Author Comment

    Thanks for the info for file uploads. Rather than say anymore, here's the file itself which should say it all.
    LVL 39

    Accepted Solution

    Ok, your buttons are sitting in frame 1 but your code is sitting in frame 2.

    move your button code to frame 1 and it will work.
    LVL 9

    Author Closing Comment

    Makes sense and it worked right away. I haven't done flash in a couple of years and I forgot about some of the subtleties of working with a timeline. Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
    In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
    The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now