A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Timeline control issue

  1. #1
    Junior Member
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    6

    Timeline control issue

    I have an SWF movie (1375 frames) and created a progress bar (248px wide) with a slider that moves according to the movie progress.
    I'm doing that next way:
    1. Calculating the distance for the slider to be moved each frame (248 / 1375)
    2. On each ENTER_FRAME moving the slider for the calculated distance


    The problem is - the movie ends far before the slider reaches the end of the progress bar.

    I'm thinking that the distance (Step 1) is is somehow ends floored by Flash and the actual distance it moves the slider is smaller than required. That's why the movie ends, but the timeline control just passed the 2/3 of its way.

    My question is - is there any solution for the problem? Or any other way to go, if it's a wrong one?

    Thanks!

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    Code:
    stop();
    var amtMove:Number=248/1375;
    slider.x=slideway.x;
    btn_play.addEventListener(MouseEvent.CLICK, goPlay);
    
    function goPlay(e:Event):void {
    	slider.addEventListener(Event.ENTER_FRAME, updatePostion);
    	play();
    }
    function updatePostion(e:Event) {
    	e.currentTarget.x = slideway.x+(amtMove*currentFrame);
    }

  3. #3
    Junior Member
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    6
    Worked like a charm Thank you!

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center