Solved

Flash Pro 8 Rewind Button

Posted on 2006-06-16
3
417 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
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…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

895 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

13 Experts available now in Live!

Get 1:1 Help Now