Link to home
Start Free TrialLog in
Avatar of Arnold Layne
Arnold LayneFlag for United States of America

asked on

using buttons to go to a frame number

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
{
      gotoAndStop(2);
}

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
Avatar of blue-genie
blue-genie
Flag of South Africa image

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?
fl_ClickToGoToAndStopAtFrame

try using www.ee-stuff.com to upload your file alternatively go to your publish settings and deselect  include xmp metadata and try again.
Avatar of Arnold Layne

ASKER

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

https://filedb.experts-exchange.com/incoming/ee-stuff/8278-danger.fla
ASKER CERTIFIED SOLUTION
Avatar of blue-genie
blue-genie
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.