Arnold Layne
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_ClickToGoToAndStopAtFra me);
function fl_ClickToGoToAndStopAtFra me(event:M ouseEvent) :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
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(
function fl_ClickToGoToAndStopAtFra
{
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
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
https://filedb.experts-exchange.com/incoming/ee-stuff/8278-danger.fla
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
does your timeline go to frame 2?
does this function get triggered?
fl_ClickToGoToAndStopAtFra
try using www.ee-stuff.com to upload your file alternatively go to your publish settings and deselect include xmp metadata and try again.