School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,489 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,811 people online right now. Registration is fast and FREE... Join Now!




see the movie progress in flash

 

see the movie progress in flash, i want to be able to do a movie timeline like in the movie player

ahbond

13 Feb, 2009 - 08:36 PM
Post #1

New D.I.C Head
*

Joined: 5 Oct, 2006
Posts: 14


My Contributions
i want to be able to do a movie time line like in the movie player, where we can drag the playtime where ever we want. after i click play button, the pointer will start moving from the line and ended at the line's end when the movie also end. my play button is myPlayBtn, stop is myStopBtn, rewind is rewBtn, fast forward is ffBtn, repeat is repeatBtn. please help me. i can controll my movie already. just cant see it progress.Attached Image

User is offlineProfile CardPM
+Quote Post


zaferaltun

RE: See The Movie Progress In Flash

26 May, 2009 - 03:17 AM
Post #2

New D.I.C Head
*

Joined: 26 May, 2009
Posts: 5


My Contributions
First of all, which as version you using? 2.0 or 3.0? Let me explain in 3.0:

Try to check currentFrame and totalFrames values of the movie in an enter frame event. You can calculate the progress rate with currentFrame / totalFrames and draw the progress bar dynamically with "graphics" class by using this rate value. Here is an example for 200px width and 8px height progress bar:

CODE

function drawProgressBar(e:Event)
{
     var rate:Number = movie.currentFrame / movie.totalFrames;

     with (movie.graphics)
     {
          clear();
          // Draw played part
          beginFill(0xFFCC00, 1);
          drawRect(0, 0, rate * 200, 8);
          endFill();

          // Draw remaining part
          beginFill(0xCCCCCC, 1);
          drawRect(rate * 200, 0, 200 - (rate * 200), 8);
          endFill();
     }
}

addEventListener(Event.ENTER_FRAME, drawProgressBar);

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 04:14AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month