Results 1 to 5 of 5

Thread: Progress Bar for a Movie

  1. #1

    Progress Bar for a Movie

    I want to have a bar display the progress of a movie while it plays, like on Quicktime, Windows Media, etc.

    I tried to use a preloader as a template while substituting frames for bytes, but I am having no luck. I used the following code on an instance of a symbol that appears throughout the movie, but that might not be the right method anyway:

    onClipEvent (enterFrame) {
    lframe = _root._currentframe;
    tframe = _root._totalframes;
    percentFrame = Math.floor ((1frame/tframe)*100));
    }
    onClipEvent (enterFrame) {
    bar.progress._xscale = percentProgress;

    "bar" is the instance name of a box on the main timeline, and "progress" is the instance name of a line inside of the symbol "bar" that I am hoping to have expand while the movie plays. I attached the .fla to make it easier...

    Thanks, in advance, for the help,

    Asianmoths

  2. #2
    Hi asianmoths,

    Have you seen this before. It is a pre-made movie controller that comes with Flash MX. It will work with imported videos or main timeline animation.

    http://www.macromedia.com/desdev/tip/019.html

  3. #3

    Tremendous

    That is EXACTLY what I needed. Thanks, and thanks for the quick turnaround.

  4. #4
    let's fix your script

    first .. you don't need to use the same handler twice:
    Code:
    onClipEvent (enterFrame) {
    	lframe = _root._currentframe
    	tframe = _root._totalframes
    	percentFrame = Math.floor ((1frame/tframe)*100))
    }
    onClipEvent (enterFrame) {
    	bar.progress._xscale = percentProgress
    }
    so you could just use:
    Code:
    onClipEvent (enterFrame) {
    	lframe = _root._currentframe
    	tframe = _root._totalframes
    	percentFrame = Math.floor ((1frame/tframe)*100))
    	bar.progress._xscale = percentProgress
    }
    now .. your script is a mess !!

    you're targetting wrong
    it should be _root.bar.progress
    but the script is in the movie clip progress so you can use this instead

    another mistake ..
    Code:
    onClipEvent (enterFrame) {
    	lframe = _root._currentframe
    	tframe = _root._totalframes
    	percentFrame = Math.floor ((1frame/tframe)*100))
    	bar.progress._xscale = percentProgress
    }
    and another one !!
    Code:
    onClipEvent (enterFrame) {
    	lframe = _root._currentframe
    	tframe = _root._totalframes
    	percentFrame = Math.floor ((1frame/tframe)*100))
    	bar.progress._xscale = percentProgress
    }

    your script should be:
    Code:
    onClipEvent (enterFrame) {
    	lframe = _root._currentframe;
    	tframe = _root._totalframes;
    	percentFrame = ((lframe/tframe)*100)
    	this._xscale = percentFrame
    }

  5. #5
    Here is another video controller that looks identical to the QT controller. Read through documentation on how to use.

    http://www.flashcomponents.net/compo...fm?nav=2&id=71

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012