Link to home
Start Free TrialLog in
Avatar of alexnexus
alexnexus

asked on

I NEED TO INPROVE THE CODE ON A MOVIECLIP, TO CONTROL ITS PLAYING SPEED!!

Hi!

I am using this code on a movieClip to make it go from a certain frame to another (backwards or forward) depending on a global variable value. I set the global variable value by pressing buttons.
It works great!

Now: I need to control the playing speed of the movieClip, just by changing a value number directly on the code.
I believe that a 'setInterval' will work, but I don't know exactly where or how.

Can you help me?

Thanks!
Alejandro


CODE:
=============================
// This one goes on the root frame 1. It sets the global variable.
_global.destframe=1

//This one goes on the movieClip that plays backwards or forward, depending on the global variable value.
onClipEvent (enterFrame) {
      if (this._currentframe<_global.destframe) {
            this.nextFrame();
      } else if (this._currentframe>_global.destframe) {
            this.prevFrame();
      }
}
==============================
ASKER CERTIFIED SOLUTION
Avatar of blockage1
blockage1

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of alexnexus
alexnexus

ASKER

Thanks!