• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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

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
kasilof
Asked:
kasilof
1 Solution
 
ProactivationCommented:
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
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.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now