A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Movie clip lag

  1. #1
    Junior Member
    Join Date
    Oct 2007

    Movie clip lag

    How can I make several movie clips run at the same time, each with their own properties and hit detections, without getting so much graphical lag?

    Currently, I have a hero, a Movable level map (moves with the char)...and several enemies on each map.

    each enemy has hit detections and a movement cycle to move up then down or side to side. they move using code. The properties are all in the movieclips, so I can simply drag and drop instances on the stage.

    would making them move with via animation help the lag?

    As of right now, it's pretty slow. I think the hit detections are also making it slow.

  2. #2
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Portland Oregon
    increase framerate to 30

    use AS tweening instead of timeline

    Lower tweened image quality and size

    Check your loops for recursion

    Delete onEnterframe Events if not leaving the frame and event has finished

    Stagger large tweens. Dont do a lot of tweens at the same time but rather stagger them so as to not bogged down the system.

    Check how much system resources the main movie takes without the tweens. If it is high, try to debug and find out what can be done to remove the bottle necks( code optimization)


  3. #3
    Junior Member
    Join Date
    Oct 2007
    Thanks, I will give this a try, I'll post the results later.

  4. #4
    Junior Member
    Join Date
    Oct 2007
    Ok well it's better than it was. I turned the FPS from 15,to 30, and right away I noticed it was smoother. I also lowered the resolution of the actual stage, though I don't know if that fixed anything. I'll also clean up some of the code. Alot of it was created just making things work properly, and probably could be cleaner.

    Not too sure what AS tweening is, but I'll look into it. I probably know, but don't recognise the name.

    Ok, I removed the movement code entirely, enemies now move simply by the tween I made to make them go back and forth. I also figured out, that by doing this, all I have to do is rotate the movieclip to make it move in other directions...Heh, learn something new everyday. It's pretty cool, and things are running smooth now.
    Last edited by yourmojo; 11-06-2007 at 12:53 PM.

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