Solved

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

Posted on 2009-03-31
5
894 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.

763 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