Be a Supporter!

Loader bar not working

  • 237 Views
  • 4 Replies
New Topic Respond to this Topic
AwesomeTurtwig
AwesomeTurtwig
  • Member since: Jun. 24, 2010
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Loader bar not working 2011-04-30 15:28:35 Reply

The flash I'm making stays at a white screen until loaded on a site I'm testing it on. Then the loading screen flashes and it's off to the main menu.

I'm using this code on the root of the first frame, and it is AS2

this.onEnterFrame = function(){
total = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
percent = Math.round(loaded/total);
loadtxt = percent+"% Loaded";
loaderb._xscale = percent;
if (loaded == total) {
gotoAndStop(2);
} else {
stop();
}
}

Any ideas why the game waits to load before it even goes to the first frame?

AwesomeTurtwig
AwesomeTurtwig
  • Member since: Jun. 24, 2010
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Loader bar not working 2011-04-30 17:20:03 Reply

Here's my publish setting, maybe this is the problem.

Loader bar not working

Xyresic
Xyresic
  • Member since: Dec. 15, 2006
  • Offline.
Forum Stats
Member
Level 19
Musician
Response to Loader bar not working 2011-04-30 21:17:48 Reply

Does your game have a lot of sounds/images/components? Anything that it has to load externally?
In any case, the easiest thing to do is to go into the publishing settings, click on the "Settings" button next to the 'Script' box and change the export frame for classes to frame 2.


bork bork bork

AwesomeTurtwig
AwesomeTurtwig
  • Member since: Jun. 24, 2010
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Loader bar not working 2011-04-30 21:45:36 Reply

At 4/30/11 09:17 PM, crapatflash wrote: Does your game have a lot of sounds/images/components? Anything that it has to load externally?
In any case, the easiest thing to do is to go into the publishing settings, click on the "Settings" button next to the 'Script' box and change the export frame for classes to frame 2.

All the files are in the library. Thanks for helping, but I could still use more.

23450
23450
  • Member since: May. 28, 2003
  • Offline.
Forum Stats
Supporter
Level 27
Blank Slate
Response to Loader bar not working 2011-05-01 13:22:53 Reply

At 4/30/11 09:45 PM, AwesomeTurtwig wrote:
At 4/30/11 09:17 PM, crapatflash wrote: Does your game have a lot of sounds/images/components? Anything that it has to load externally?
In any case, the easiest thing to do is to go into the publishing settings, click on the "Settings" button next to the 'Script' box and change the export frame for classes to frame 2.
All the files are in the library. Thanks for helping, but I could still use more.

Its actually exactly what you need.

This is a classic problem with flash and making preloaders. Keep in mind, I was not aware of his suggestion of changing to export to frame 2. Sounds like it might work though, so give it a try.

The old school way of fixing this issue was unchecking export in first frame for classes, then taking all your dynamic movieclips (dynamic as in it links to a class) and physically placing them in the second frame of your movie. Being placed there will load their class for use later on in the game, and when its physically placed like that, the preloader loads them correctly.

But again, it sounds like crapatflash's suggestion is doing basically the same thing. not 100% sure though. Give it all a try.


BBS Signature