Solved

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

Posted on 2009-03-31
5
896 Views
Last Modified: 2013-11-11
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
0
Comment
Question by:Matt_Mercurio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
5 Comments
 
LVL 12

Accepted Solution

by:
scooby_56 earned 500 total points
ID: 24033063
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
 

Author Comment

by:Matt_Mercurio
ID: 24033492
Thanks Scooby.....I am going to try this code....Ill post a reply tonight.

Thanks again....
Matt
0
 

Author Comment

by:Matt_Mercurio
ID: 24034094
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
 

Author Comment

by:Matt_Mercurio
ID: 24034282
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
 

Author Closing Comment

by:Matt_Mercurio
ID: 31565021
Thnx Scooby!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

729 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