Solved

Flash Pro 8 Rewind Button

Posted on 2006-06-16
3
421 Views
Last Modified: 2012-06-21
Hi Folks

I am tring to create a rewind and a fast forward button for an animated tutorial in flash. The pause and play functions I now understand and are Ok, But I am struggling with the rewind and FF buttons

Currently the action script code I have for rewind is:

on(release){
     _root.gotoAndPlay(_root._currentframe-5);
}

However what I want to try to achieve is for the animation to rewind (in this case) for as long as the button is held down. I am guessing I have to do something to the downstroke frame on the button. I'm not very good at these things so any help would be appreciated

Lee
0
Comment
Question by:kasilof
[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
3 Comments
 
LVL 7

Accepted Solution

by:
furmiga earned 250 total points
ID: 16923357
Hi there. Here we go

rewind button

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

fast foward button

on(press)
{
      function fastfoward()
      {
            _root.gotoAndStop(_root._currentframe+5);
      }
      intervalf = setInterval(fastfoward,30)
}
on(release, releaseOutside)
{
      clearInterval(intervalf)
}

I hope it helps :)
0
 
LVL 34

Assisted Solution

by:Aneesh Chopra
Aneesh Chopra earned 250 total points
ID: 16926369
Here is another approach using onEnterFrame

just put the following code on Rewind button
---------
on (press) {
      _root.onEnterFrame = function()
      {
            if (_root._currentframe>6)
            {
                  _root.gotoAndPlay(_root._currentframe-5);
            } else
            {
                  _root.gotoAndPlay(1);
            }
      };
}
on (release, releaseOutside) {
      delete _root.onEnterFrame;
}
---------


and copy/paste following code on Forward button
--------------
on (press) {
      _root.onEnterFrame = function()
      {
            if (_root._currentframe<_root._totalframes-6)
            {
                  _root.gotoAndPlay(_root._currentframe+5);
            } else
            {
                  _root.gotoAndPlay(_root._totalframes);
            }
      };
}
on (release, releaseOutside) {
      delete _root.onEnterFrame;
}
---------------

Rgds
Aneesh
0
 

Author Comment

by:kasilof
ID: 16927032
Brilliant

Thanks Guys. this a real break through for a novice like me. I have split the points. I am posting another question about Zooming if you have any ideas.

regards Lee
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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

734 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