Solved

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

Posted on 2006-06-18
1
198 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

839 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