?
Solved

Flash MX 2004 back and next button and bg sound

Posted on 2005-03-25
3
Medium Priority
?
219 Views
Last Modified: 2012-06-21
Hi!
I have a little problem with using "back" and next" buttons and background music.

#######  Actionscript for "Next" button  ################
next_btn.onRelease=function(){
      gotoAndStop(_currentframe+5);
}


######### Actionscript for "Back" button  ############
prev_btn.onRelease=function() {
      gotoAndStop(_currentframe-5);
};

###########  The end of scripts ##############
I arranged layers as follows:
Action (to stop movie at frame 1)
Back (for "Back" button")
Next (for "Next" button)
Content (to place images every five frames)
Content container mov (a movie to be used as background of the images)
sound (mp3)
background (overall background)

The problem is that the "Back" button does not work when it is moved right to begin at frame 5 (it works fine when it starts at frame 1).  I got an error message saying, "Statement must appear within on handler
     next_btn.onRelease=function(){ ".

Another problem is that when I used "Back" button ("Back" button works when it begins at frame 1), the background music restarts in addition to the original flow of music, and when I pressed "Back" button several times, the background music turns into a total noise. Is there anyway to keep the use of "Back" button from disrupting the background music?

Hope to hear your geniuses' valuable advice and suggestions!

duta1
Friday, March 25, 2005, at 1:14 pm



0
Comment
Question by:duta1
[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
  • 2
3 Comments
 
LVL 8

Accepted Solution

by:
sokhodom earned 2000 total points
ID: 13633223
hi,
>>The problem is that the "Back" button does not work
You can solve it by attached the actionscript directly to the button, like this:

On Prev_btn
-------------------------------------------
on (release) {
     gotoAndStop(_currentframe-5);
};
-------------------------------------------

On next_btn
-------------------------------------------
on (release) {
     gotoAndStop(_currentframe+5);
};
-------------------------------------------

Delete those actionscript you wrote in the main time line. Then make sure that the above scripts are attached to the button ON EVERY Keyframe (sometimes you forget to put it in some keyframes and it wont work)

---------------------------------------------------------------
>>the background music turns into a total noise
You solve this by:
- click on sound (mp3) Layer (i suppose you attached the mp3 by moving it from library to the main stage)
- Open the Property Inspector by pressing CTRL + F3
- Change the SYNC variable to "Start" instead of "Event"
---------------------------
Sokhodom
0
 

Author Comment

by:duta1
ID: 13633329
Dear Sokhodom:

Thank you so much for your very, kind, super help.

Your suggestions worked great.

I am a very beginner in Flash, and I expect and hope to get more wonderful help from you genius.

Thanks again!

duta1
Friday at 3:13 pm (March 25, 2005)
0
 
LVL 8

Expert Comment

by:sokhodom
ID: 13635042
You are welcome duta1 :)
Here is a great source to learn,

Sokhodom
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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 record live broadcast.

765 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