dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: CPU usage, BIG

  1. #1
    Member
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    81

    CPU usage, BIG

    When I make a movie clip with the following script:

    onClipEvent(enterFrame){
    if(_root._xmouse <= 50){
    _root.raster._x = _root.raster._x + 5;
    }
    if(_root._xmouse >= 500){
    _root.raster._x = _root.raster._x - 5;
    }
    if(_root._ymouse <= 50){
    _root.raster._y = _root.raster._y + 5;
    }
    if(_root._ymouse >= 500){
    _root.raster._y = _root.raster._y - 5;
    }
    }

    my CPU usage gets very high. My processor is a AMD 2600+. But even when I have a stupid processor, there are other ppl who have worse processors then this one. And I dont want to lag their pc's, if you know what i mean.

    How can I prevent such things? What is the best way to scroll through a game level?

  2. #2
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    You will probably find that it isn't the code that is at fault. You probably want to optimise your 'raster' movieclip. What is in the raster clip?
    If it ain't broke, don't fix it.

  3. #3
    Member
    Join Date
    Apr 2004
    Location
    Netherlands
    Posts
    81
    a bitmap in a movieclip

  4. #4
    Grandmaster Flash
    Join Date
    Apr 2004
    Location
    Edinburgh, Scotland
    Posts
    139
    How big is the bitmap? What framerate is the movie running at? If it's at 12 FPS try at least twice that and see if that improves things.
    If it ain't broke, don't fix it.

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