Solved

Flash Pro 8 Problem with movie control buttons when going to 2nd scene

Posted on 2006-06-18
1
197 Views
Last Modified: 2010-04-03
Hi Folks

I am having problems with my flash movie control buttons when copying them to a second scene. They work fine in the first scene but as soon as I copy them to a 2nd scene things start to go wrong. They are your normal, pause, play, ff and rewind. I am copying by using edit>timeline>copy frames. Then pasting into the new scene on a new layer. The problem is that when I come to use the test movie option in control the whole thing grinds to a halt. I have gradually worked backwards through the process and find the problem stops when I remove the actions, so I guess I have some coding error or set up error.

A sample code for the rewind button is below.

on(press)
{
     function rewind()
     {
          _root.gotoAndStop(_root._currentframe-5);
     }
     intervalr = setInterval(rewind,50)
}
on(release, releaseOutside)
{
     clearInterval(intervalr)
}

On the one occasion it did manage to open a test screen up the buttons were doing all sorts of confusing things.

What am I doing wrong?

Lee
0
Comment
Question by:kasilof
1 Comment
 
LVL 12

Accepted Solution

by:
Proactivation earned 500 total points
ID: 16967590
OK, a few observations:

1. You're using scenes.  Scenes are bad.  Don't use scenes.
2. It's better practice to put your actions in a frame rather than on the button itself, like this:

function rewind() {
      _root.gotoAndStop(_root._currentframe - 5);
}
var interval;
myButton.onPress = function() {
      intervalr = setInterval(rewind, 50);
};
myButton.onRelease = function() {
      //whatever
};

3. You're setting a callback when the user's mouse button is down, and clearing it again when they release it. Are you sure you want to do this..?
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to put actionscript code for a button? 6 129
Embedding Flash App/Movie on Website 3 496
flash cs6 4 346
Windows 7, Adobe Flash Player and Internet Explorer 11 15 98
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
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…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

809 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