Solved

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

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Microsoft WSUS 4 82
Flash Slides/Presnetation 4 70
Flash Player Action Script Error 1090 5 177
Advertising design for my own Purpose 5 65
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
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 motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now