A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Preloader freezes on 50% when loading certain pages

  1. #1
    Member
    Join Date
    Jul 2009
    Location
    Florianópolis
    Posts
    81

    Preloader freezes on 50% when loading certain pages

    I´m developing a website with Gaia Flash Framework and I´ve been having the following problem (which is probably not related to the Gaia Framework, though):

    My preloader freezes on 50% when loading certain pages for a couple of minutes (around 2). Then sometimes it continues to load the page, sometimes I get a blank page with a sign with an exclamation point.

    That happens with the exactly three pages of the website that load dynamic content from php files (redirected via htaccess) that return xml content. Those pages are 'Colecoes', 'News' and 'Eventos'.

    http://agenciahive-ws.floripa.com.br/~tida

    That happens with IE, Chrome, Opera and Safari but not with Firefox.
    Actually, Safari outputed this:

    Error: Error #1502: Um script foi executado por mais tempo que o perÃ*odo limite padrão de 15 segundos.
    at br.com.tida::PreloaderScaffold/onProgress()
    at br.com.tida::Preloader/onProgress()
    ...

    Code:
    		public function onProgress(event:AssetEvent):void
    		{
    			if (midPoint)
    			{
    				pcent = Math.round(event.perc * 100) || 0;
    				preloader.perc.text = pcent + "%";
    				pizza.graphics.clear();
    				pizza.graphics.beginFill(0, 100);
    				pizza.graphics.moveTo(midPoint._x, midPoint._y);
    				pizza.graphics.lineTo((cos(0*d_r)*r)+midPoint._x, (sin(0*d_r)*r)+midPoint._y);
    				for (var z = 0; z <= pcent*3.6; z++) {
    					pizza.graphics.lineTo((cos(z*d_r)*r)+midPoint._x, (sin(z*d_r)*r)+midPoint._y);
    				}
    				pizza.graphics.lineTo(midPoint._x, midPoint._y);
    				pizza.graphics.endFill()
    				
    				if (event.loaded == event.total) {
    					pizza.graphics.clear()
    				}
    			}
    		}
    I´m using 'Byte Accuracy Preloading' method with Gaia, maybe there´s something to do with that?

    Does anyone knows what´s going on here ?

    Thanks in advance

  2. #2
    Senior Member
    Join Date
    Aug 2009
    Location
    Scotland & England
    Posts
    117
    Hmmm I wonder if has any thing to do with this:

    http://www.beakable.com/img/temp.jpg

    Flash taking to long to load in the image and the scipt perhaps breaking :?

    I'll have a play about with your site in other browsers, see if anything jumps out .

  3. #3
    Senior Member
    Join Date
    Aug 2009
    Location
    Scotland & England
    Posts
    117
    Hmmm in IE8 it pretty much just dies out and doesn't get anywhere as far as my FF screenshot.

    Chrome clicking News gives the feeling that Flash is dead and explains your 15 second script timeout message which Safari gave you.

    Seeing as it works in FF I doubt it is the same issue but the project I'm working on just now uses over 1300 pngs, Flash was dieing on the initial preload due to one of the images being corrupted on their server. I'm not really sure how to go about debugging this, how large is your source?

  4. #4
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    Well, I can tell you it seems like it is timing out. That's what this says in spanish right?

    Error: Error #1502: Um script foi executado por mais tempo que o perÃ*odo limite padrão de 15 segundos.

    I took spanish a long time ago but I think I get the gist. What's the size of the images in mb's? Maybe set the script to timeout at a longer period?

    set_time_limit(100);
    max_execution_time(100);

    Normally, you get 30 seconds. That error says it waited 15. Try 100.


    Okay, now that's if it's the server. But, I really don't think it is. I think it's your preloader.

    I bet it's here:

    PHP Code:
    for (var 0<= pcent*3.6z++) {
        
    pizza.graphics.lineTo((cos(z*d_r)*r)+midPoint._x, (sin(z*d_r)*r)+midPoint._y);

    It's taking too long to build out these points. In FF the movie for me loaded when I was only at 10% or so. And the thing ran slower as the line moved farther. It looks like your building the outer circle with the draw method but starting at the beginning everytime. Store the last point and then draw on from there in each iteration. Or, mask the thing and just play the frames - probably much faster.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  5. #5
    Member
    Join Date
    Jul 2009
    Location
    Florianópolis
    Posts
    81
    I´ve made a reply , but I lost it ... damn..bref:

    thanks for answering!

    mneil, you got it I took out that code and it worked. then i made it like that:

    Code:
    		public function onProgress(event:AssetEvent):void
    		{
    			if (midPoint){
    		
    				pcent = Math.round(event.perc * 100) || 0;
    		
    				preloader.perc.text = pcent + "%";
    				
    				var z:Number = pcent*3.6;
    				pizza.graphics.beginFill(0, 100);
    				pizza.graphics.lineTo(lastPoint._x, lastPoint._y);
    				
    				while (counter < z){
    					lastPoint = {_x:(cos(counter*d_r)*r) + midPoint._x, _y:(sin(counter*d_r)*r) + midPoint._y};
    					pizza.graphics.lineTo(lastPoint._x, lastPoint._y);
    					counter++;
    				}
    				
    				pizza.graphics.lineTo(midPoint._x, midPoint._y);
    				pizza.graphics.endFill()
    				
    				if (event.loaded == event.total) {
    					pizza.graphics.clear();
    					preparePizza();
    				}
    			}
    		}
    I had to put the 'while' cause the circle wasn´t drawing correctly, as if the onProgress function runned while it was 57 pcent loaded and then with 80 pcent loaded, then it drawed a straight line between those points.

    without the pizza code, it runned well. but the percent number of the preloaded disappeared after 50%, leaving the '%' sign alone. I believe that might be the AssetEvent of the Gaia Framework, whose 'event.perc' doesn´t return a number after 50% ... if i use 'preload=false' on the asset nodes in site.xml , it loads the pages correctly but show no content ( cause the xml filesdon´t get loaded)

    Code:
    <asset id="colecoes" preload="false" src="lib/xml/colecoes.xml"/>



    Beakers, the entire source is 64 mb, but 58mb are the cms files, which are mainly images for the gallery (there´s quite a lot of them)

  6. #6
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    I feel like I won a gameshow! I'm glad you got it fixed.
    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  7. #7
    Member
    Join Date
    Jul 2009
    Location
    Florianópolis
    Posts
    81
    Well, that wasn´t actually the real problem - you helped me to heal a "symptom" of the problem !! (a very important one though!)

    That means, now I can get those pages to load with no crash/delay, but I can´t have a preloader (at least one that works after 50%).

    So, for the moment, I took off the preloader of those pages, til I find out what causes that problem.

    Thanks!

Tags for this Thread

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