Avatar of paulCardiff
paulCardiff asked on

How do I use conditional statements to navigate from one frame to another via a motion tween?

I have a Flash movie which uses conditional statements to navigate one frame at a time similar to a slide show, however I want to navigate with a motion tween between the frames. i.e.

when the user clicks i want the movie to go from frame 1 to frame 10. At the moment is goes frame1, click frame 2, click frame 3 etc. I have a motion tween between frame 1 and 10 and i want the movie to go frame 1, click .....tween.....frame 10.

I also want the option to go to previous frame in the same way.

Please help.

function goBack(event:MouseEvent):void
	if(currentFrame == 1)
function goForward(event:MouseEvent):void
	if(currentFrame == totalFrames)
back_btn.addEventListener(MouseEvent.CLICK, goBack);
next_btn.addEventListener(MouseEvent.CLICK, goForward);

Open in new window

Adobe Flash

Avatar of undefined
Last Comment

8/22/2022 - Mon

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

absolutely fantastic, thank you so  much, superb bit of code.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy