A Flash Developer Resource Site

Results 1 to 19 of 19

Thread: [Help] Laggy in browser

  1. #1

    [Help] Laggy in browser

    Hi, I have just finished a demo version of the game i'm working on and now that i put it on a web page, there is slow down.. The .swf runs perfectly when played from my computer. I don't understand... Anyone experienced a similar problem?

    (I use Flash 8, actionscript 1.0, 30fps, the game is a shooter... if you need any other info let me know)
    Thank you!

    BTW, lowering the quality doesn't seem to improve the performance so I guess the lag has nothing to do with the graphics.

  2. #2
    Wait- what now? tidenburg's Avatar
    Join Date
    Dec 2005
    Posts
    1,471
    Is it preloaded?

  3. #3
    Senior Member Ray Beez's Avatar
    Join Date
    Jun 2000
    Posts
    2,793
    There are plenty of threads about optimizing performance and also the performance differences between Flash Player, Browser versions, PC vs Mac, etc

    Set your FPS to 31 for starters, don't use WMODE = transparent for FireFox (but in IE you get a boost), etc, etc

  4. #4
    Quote Originally Posted by tidenburg
    Is it preloaded?
    Is it better to be preloaded? or without?

  5. #5
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    preloading wont help, its the way browsers can run activeX content, firefox is not good at it. Something about using up the whole screen for a flash movie or something, and i think it limits the amount of CPU given to the player.

    WMODE speeds it up in IE, but big problems occur in firefox (loosing keyboard keys). Currently there is no solution, until someone can figure out how to keep frame rates up in browsers it'll stay as it is. Which sucks
    lather yourself up with soap - soap arcade

  6. #6
    Adding a preloader didn't help
    And changing fps to 31 too..
    Not sure what WMODE is, i'll do research..
    Any other suggestions??

  7. #7
    OK i did research for WMODE and found this page:

    Adobe - Tech Note : How to make a Flash movie with a transparent background

    Here are the results when wmode is set to transparent:
    It works perfectly in IE, but as mentioned by Mr Malee, in FireFox i lose control of keyboard keys.

    The thing I don't like though, is that if my page is too long (what i mean is: there is some text below my .swf file) it scrolls up and down if I hit the up and down arrow keys wich is very annoying while playing the game!

    EDIT: Earlier, i said it worked in firefox too but that it was still laggy.. it's not true: it's not laggy, but I don't have control of keyboard. (my browser probably didn't recognize the changes at the time)

    I can live that, i'll just have to put an advertisement wich says "Internet Explorer recommended" or something.
    But is there anything to do about the unwanted scrolling? (without, of course, removing the text from my page)
    Last edited by SnailsAnimation; 06-05-2007 at 03:27 AM.

  8. #8
    Pumpkin Carving 2008 ImprisonedPride's Avatar
    Join Date
    Apr 2006
    Location
    Grand Rapids MI
    Posts
    2,378
    Hmmm I've never experianced the scroll if the swf has focus. If it doesn't then yeah, most browsers use the UP and DOWN keys to scroll as preset keys.
    The 'Boose':
    ASUS Sabertooth P67 TUF
    Intel Core i7-2600K Quad-Core Sandy Bridge 3.4GHz Overclocked to 4.2GHz
    8GB G.Skill Ripjaws 1600 DDR3
    ASUS ENGTX550 TI DC/DI/1GD5 GeForce GTX 550 Ti (Fermi) 1GB 1GDDR5 (Overclocked to 1.1GHz)
    New addition: OCZ Vertex 240GB SATA III SSD
    WEI Score: 7.6

  9. #9
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    ...have to put an advertisement wich says "Internet Explorer recommended"
    are you insane o_O

  10. #10
    Senior Member
    Join Date
    Sep 2006
    Posts
    132
    Set your FPS to 31 for starters
    I think this is a workaround for older versions of the Mac player. Snails, are you planning to publish to the Mac player?
    Last edited by programicks; 06-05-2007 at 07:48 AM.
    May 2009 - Working on Thorenzitha RPG - episode 7

  11. #11
    Quote Originally Posted by programicks
    I think this is a workaround for older versions of the Mac player. Snails, are you planning to publish to the Mac player?
    I'm unsure of what you mean. Is "Mac player" the Flash Player for Macs? How do I publish it to the Mac player?

  12. #12
    Quote Originally Posted by renderhjs
    are you insane o_O
    I don't see why it would be insane to notify the players that the game only works with IE...

    I have 2 choices:
    - Game too laggy on both browsers
    or
    - Game perfectly playable on one of them, and not at all on the other

    The decision isn't hard to make... even if it means compromise.

  13. #13
    Senior Member
    Join Date
    Sep 2006
    Posts
    132
    I'm unsure of what you mean. Is "Mac player" the Flash Player for Macs? How do I publish it to the Mac player?
    My wording was not totally clear. It's just, do you intend for your swf to run on a Mac? As I believe, there were some issues with older mac plugins which is why it was suggested to use 31 fps. I'm sure I seen this info in a site about flash optimization. If I see the text, I'll post the link here.
    May 2009 - Working on Thorenzitha RPG - episode 7

  14. #14
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    if the controls wont work because your website is broken because it was optimized for IE then you not only exclude potential visitors but it´s also rude refering to a browser that can´t be installed everywhere or or is allowed.
    Imo. and this is personal flash html code shouldn´t be modified to something only a certain product can understand propper.

    Can you upload the swf so that we can test it how it runs on other computers and browsers

    Anyway hopefully there are other ways to optimize the flash movie rather than toying with the html standards.

  15. #15
    Member
    Join Date
    May 2007
    Posts
    46
    HOLY SMOKES!!!!!!

    WOW!! And I mean WOW!!!!!!!!!!!

    I just changed my html file (that loads my flash game) to include
    wmode="opaque" (for firefox) &
    <param name="wmode" value="opaque"> (for i.e)

    and my frame rate jumped from 24fps to 30fps! That was with the .swf exported to 30fps. I can't believe what a difference that makes!!!

    Thanks for pointing out that setting Ray Beez!

    btw, I don't lose any keyboard functionality from firefox doing this. Now my game runs at the fps I export to! Thank you!!!!!!

  16. #16
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    hmmm, i'm sure opaque had some problems too, like if you press and hold the mouse button in the player then drag it outside, the mouse becomes unrecognizable. But meh, most games dont require that
    lather yourself up with soap - soap arcade

  17. #17
    Quote Originally Posted by turtlesoup
    I just changed my html file (that loads my flash game) to include
    wmode="opaque" (for firefox) &
    <param name="wmode" value="opaque"> (for i.e)
    Thank you I didn't know wmode = "opaque" was for firefox only, so I removed it, so at least people who have firefox can play (but it's laggy) and those who have IE can run the game smoothly.

    Btw, how can you see the fps?

  18. #18
    Quote Originally Posted by renderhjs
    Can you upload the swf so that we can test it how it runs on other computers and browsers
    Sure, here is the link for the game with wmode code in it (runs smooth in IE):
    Click here
    and the one without (slow in both browsers):
    Click here
    You may download the file to your computer (there is a link below the .swf)

    This is only a demo so it's not completed (levels and story missing) and also the save feature isn't made yet.

    Quote Originally Posted by renderhjs
    Anyway hopefully there are other ways to optimize the flash movie rather than toying with the html standards.
    Yeah, I would prefer that too. Because if eventually i submit this game to game sites, they won't use the wmode code so it's probably going to be slow Any suggestions? Here is what I already do to optimize:
    -smooth all vector drawings
    -lower quality of bitmaps
    -lower quality of music and sounds

    Also, is there a way for flash to be taken in charge by the GPU instead of CPU? or allow more cpu usage?

  19. #19
    Member
    Join Date
    May 2007
    Posts
    46
    Quote Originally Posted by SnailsAnimation
    Thank you I didn't know wmode = "opaque" was for firefox only, so I removed it, so at least people who have firefox can play (but it's laggy) and those who have IE can run the game smoothly.

    Btw, how can you see the fps?

    I use the fps tool from Moock
    http://moock.org/webdesign/flash/act...ter/index.html


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