0

I have had a lot of trouble trying to make a preloader work in Actionscript 3.0. I'm also using Animate CC.

So to try to figure out how to even make it work, I downloaded Simple NG Loader from Newgrounds https://www.newgrounds.com/downloads/preloaders/ , to make sure I had a working preloader. Then I got 4 high res images from google, around 10000x10000 pixels each, adding up to 85MB, to make sure there was more than enough to load.

I placed the preloader on the first frame, and put all the images on the second along with "stop();".

When I play, the preloader instantly finishes, but it leaves me with a white screen for a while before the images eventually shows up.

If I play it using a standalone flash player, it instantly crashes.

I would really appreciate some help with this!

  • I haven't looked at the NG loader but you gotta understand that when the SWF is visible it has already loaded everything so anything on frame 2 is also already loaded. It crashes likely because your images are too large for assigned memory. Max width **or** height is 8,191 pixels. Total width X height cannot exceed 16,777,215 pixels. Anyway easiest way to test a preloader is to load an image from online source. Check **[this answer](http://stackoverflow.com/a/8411615/2057709)** for a hint. – VC.One Apr 15 '16 at 04:22
  • As far as i can remember the swf is only preloading the first frame before it becomes visible, so the images on frame 2 should be downloaded at a later point (unless the objects are marked for "Export in frame 1" in the object properties). But usually the movie should stop on frame 1 (where the preloader is) and play once the loading is done. – Philarmon Apr 15 '16 at 07:49
  • @VC.One So to ensure the swf is visible while loading, I can't manually place the images on frame 2? I have done more tests, and the standalone player no longer crashes, it just did it the first time I tested it. I checked out the answer you linked, and I want it to work with just one swf, so I followed Option 1. Using that code, it didn't end up making much difference, as it still instantly finishes. If I trace the percent in onProgress, it only gives me 100, once. Then the first frame stay frozen, which is exactly what happens with the NG Loader. – RandomlyFish Apr 16 '16 at 02:32
  • @Philarmon So I should change it so that it exports all classes in frame 2? – RandomlyFish Apr 16 '16 at 02:37

1 Answers1

1

The issue is probably that the game will already be fully loaded when you launch the swf in flash. You need to set your flash player to "Simulate Download". Do the following:

  • Hit ctrl+enter in your ide to launch the swf
  • Hit view on the menu of the swf and click simulate download.
  • The swf will now restart and pretend it's downloading. If you open view again, you can select the download speed by going to "Download Settings"
Snukus
  • 1,302
  • 9
  • 17
  • Unfortuately they didin't include simulated download in Animate CC. I could do a similar test in CS5.5, but I'm working on a project in CC, which doesn't actually work in earlier versions of Flash. – RandomlyFish Apr 16 '16 at 01:17