• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 615
  • Last Modified:

How to link a slider bar to play frames of a movie clip in Flash

I am trying to link a slider bar to control a sequence of images I have in a movie clip. It is a 3d rotation of a TV.  I have created a slider with a line and dragger, I followed the tutorial from http://www.kirupa.com/developer/mx/slider.htm

Here is the code I have in frame 1 of the movie clip that is my slider:

this.ratio=0 ;
            ratio=Math.round(this._y*100/line._height) ;

And here is the code I have in frame 1 of the movie it appears in:


My movie clip is called Images. The action script above the movie clip Images I got off a tutorial and looks like this.


var startX:Number;
var startFrame:Number;
var changeDistance:Number;
var travelDistance:Number;

Images.onPress = pressHandler;
Images.onRelease = releaseHandler;
Images.onReleaseOutside = releaseHandler;

function pressHandler():Void {
  startX = Images._xmouse;
  startFrame = Images._currentframe;
  this.onMouseMove = moveHandler;
function releaseHandler():Void {
  this.onMouseMove = null;
function moveHandler():Void {
      changeDistance = Math.round((Images._xmouse-startX)/10);
      travelDistance = startFrame+changeDistance;
      if (travelDistance>Images._totalframes) {
      } else if (travelDistance<0) {
      } else {
1 Solution
Aneesh ChopraCommented:
You can use freely available movieController component


You just need to register for Flashloaded newsletter with a valid email and you can download this freebie component
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now