Solved

Progress Event only shows when close to finishing the load

Posted on 2011-02-13
6
549 Views
Last Modified: 2013-11-11
I'm loading a swf that's about 3MB in size so it takes about 4 seconds to load. Simple stuff yet the text field only updates just prior to the file being loaded and not during the majority of the loading. I've included the file code here. Any suggestions why it's not working correctly. The other odd thing is that if I have the trace statement it spits out all the values but it displays them all at once only after the load is done. It's like there's something hanging up flash that doesn't allow it to trace the numbers either...This might explain why the text field only shows up 100% right when it's done.
Security.allowDomain("*");
var myMovie:Sprite;
 
var l:Loader = new Loader();
l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop, false, 0, true);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done, false, 0, true);
l.load(new URLRequest("http://www.grxsolutions.com/gtslideshow3/slides/sampleslide2.swf?c="+Math.random()));
 
function loop(e:ProgressEvent):void
{
  var perc:Number = e.bytesLoaded / e.bytesTotal;
  percent.text = Math.ceil(perc*100).toString();
  //trace(e.bytesLoaded+" "+e.bytesTotal);
}
 
function done(e:Event):void
{
  percent = null;
  myMovie = Sprite(l.content);
  addChildAt(myMovie,0);
  l.contentLoaderInfo.removeEventListener( ProgressEvent.PROGRESS, loop);
  l.contentLoaderInfo.removeEventListener(Event.COMPLETE, done);
  l = null;
}

Open in new window

0
Comment
Question by:docaberle
  • 3
  • 2
6 Comments
 

Author Comment

by:docaberle
ID: 34884998
I increased the size of the loaded swf to 10MB instead of 2MB and since I'm on a high speed internet connection the numbers now appear correct. I once saw 3%, then 11% so I think that was the only problem. It's hard to test low speed internet connections when you're on a high speed. I know life is rough.
0
 
LVL 19

Expert Comment

by:Gary Benade
ID: 34885957
You can simulate slow bandwidth in the flash player

Run the movie from the flash IDE

click View->Download Setting and select the bandwidth you want to test on

then

click View->Simulate Download
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 34886081
if you find your preloader starts showing up later it's could also be that you have too many items that have export for frame 1 selected - you can't just turn that all off, it depends how you've coded, but if your file is too frame 1 heavy, your preloader needs to load all that first.
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:docaberle
ID: 34888126
blue-genie: Are you referring to frame 1 of the swf that I'm loading or the main swf? because yes all the assets in the loaded swf's are in frame 1 because I was trying to bulk them up due to my fast internet connection. Or do I need to test these preloaders on a 56k modem?
0
 

Author Comment

by:docaberle
ID: 34888128
hobbit72: As for testing in the IDE, my main swf is downloading from the internet so isn't that different? ie the loaded swf's are all on the server except for my main swf which is run from the IDE.
0
 
LVL 39

Accepted Solution

by:
blue-genie earned 500 total points
ID: 34888470
if you have a bunch of linkages that says export in frame 1 and that are on the stage in frame 1, then yes that will cause the problem you're experiencing.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Stop Ads in Browser Google Chrome 3 541
Youtube video error 30 773
Crash with shockwave flash 8 245
Could you point a workaround on how to open this Adobe Flash documents? 5 144
This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question