A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Movieclip stop drawing bitmapdata continuously

  1. #1
    Member
    Join Date
    Sep 2010
    Posts
    32

    Unhappy Movieclip stop drawing bitmapdata continuously

    Code:
    // currentTime
    var currentPlayerTime = 0;
    
    // Blank MovieClip
    var timeLineEdit:MovieClip = new MovieClip();
    	MovieClip(root).addChild(timeLineEdit);
    
    // 60 seconds 
    var movieDuration:Number = 60.5;
    
    	// Looping through
    	for(var j = 0; j<Math.ceil(movieDuration); j++){
    		// instance of timeline MC
    		var timeLineMC:timeLineClass = new timeLineClass();
    			timeLineMC.timeLineX.text = j+1;
    
    		// create bitmapData of timelien MC
    		var timeLineBMD:BitmapData = new BitmapData(timeLineMC.width, timeLineMC.height);
    			timeLineBMD.draw(timeLineMC);
    			
    		//make MC width of movie in seconds
    		timeLineEdit.graphics.beginBitmapFill(timeLineBMD);
    		timeLineEdit.graphics.drawRect(j*timeLineMC.width, 0, timeLineMC.width, timeLineMC.height);
    		timeLineEdit.graphics.endFill();
    
    	}
    	
    	
    stage.addEventListener(Event.ENTER_FRAME, EnterFrame);
    function EnterFrame(e:Event):void{
    	
    	// simulating player
    	currentPlayerTime = currentPlayerTime + (1/30);
    	
    	// Moving timeline base on currentPlayerTime
    	timeLineEdit.x = -((timeLineEdit.width/movieDuration)*currentPlayerTime);
    }
    I would appreciate any help at all.

    Basically, I have a 800px width image thats represent one second in the movie.
    Ex. 60.5 seconds of a movie should have a timeline 48,400px (timeLineEdit)
    but, for some reason at the 42 seconds mark or 33,600px mark the timeline stop moving...

    Extra Info:
    The timeLineClass is a MC which is a timeline with a dynamic text that correlate to the seconds of the movie
    test.png


    Preview
    http://meudtv.netai.net/test.html
    I've also attach the test.fla
    Attached Files Attached Files
    Last edited by onenonly; 11-11-2014 at 06:51 AM.

  2. #2
    Member
    Join Date
    Sep 2010
    Posts
    32
    I may have added wrong fla
    here the updated one
    Attached Files Attached Files

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