Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


using buttons to go to a frame number

Posted on 2012-09-05
Medium Priority
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
  • 2
  • 2
LVL 39

Expert Comment

ID: 38367725
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 www.ee-stuff.com to upload your file alternatively go to your publish settings and deselect  include xmp metadata and try again.

Author Comment

ID: 38367854
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

blue-genie earned 2000 total points
ID: 38371176
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.

Author Closing Comment

ID: 38371898
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.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

580 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