How do you perform a simple "frame jump" in Adobe Flash CS4 using actionscript 3?

Experts,

I am trying to do a very simple task by placing a button (some text) in my flash movie, and when clicked on, it will jump to another frame a little further down the time-line in the same scene.

I have scoured the net looking for the code to insert and I can not find it anywhere. I know this is got to be a very simple task and I apologize for being so actionscript 3 / flash ignorant.

Thanks for your help.

Matt
Matt_MercurioAsked:
Who is Participating?
 
scooby_56Connect With a Mentor Commented:
btn.addEventListener(MouseEvent.CLICK, onClick)   //replace btn with the name of your button
function onClick(e:MouseEvent){
      gotoAndPlay(30); //30 is the frame number
}
0
 
Matt_MercurioAuthor Commented:
Thanks Scooby.....I am going to try this code....Ill post a reply tonight.

Thanks again....
Matt
0
 
Matt_MercurioAuthor Commented:
Hey Scooby...thanks for the code it works. However, I have a related problem. I apologize I didn't tell you this up front...I just didn't think it made a big difference but apparently it does.

Anyway, here is the issue, I have four other buttons in the scene that I have applied this same code too. When I applied it to just one button in the scene...all is well. However, the minute I apply it to the other buttons, I get the following error message.

"1021: Duplicate function definition."

Thanks,
Matt
0
 
Matt_MercurioAuthor Commented:
Scooby...nevermind...I got it! The minute I hit the post button...I realized that I need a unique function name.

Thanks for your help!
0
 
Matt_MercurioAuthor Commented:
Thnx Scooby!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.