Be a Supporter!

Preloader problems... save me T_T

  • 291 Views
  • 5 Replies
New Topic Respond to this Topic
Fatelogic
Fatelogic
  • Member since: May. 3, 2012
  • Offline.
Forum Stats
Member
Level 13
Artist
Preloader problems... save me T_T 2013-01-17 14:47:46 Reply

Ssup people. Fate here, as always. Today I have for you, oh flash gurus, a serious question, since it's breaking my brain in half and I can't seem to get it right...

Ok, let me explain a little what my problem is all about.

A while back (kinda 5 months or so), I did my very first flash game. A simple set of scenes linked by a set of buttons, nothing special. As a way to preload it, I used a preloader tutorial at "Republic of Code", and it worked fine for me. It showed a simple bar filling up until the game was fully loaded, then made a "play" button visible, and once clicked, the game started. All fine and dandy.

Since this worked well the last time, I decided to do exactly the same for the new game I'm near to complete this days. I even copied the exact same script from my last game (and made sure that all the variables were referencing objects that existed in this new game, obviously).

This is the code for the preloader used in my new game (at frame one):

stop();

this.addEventListener(Event.ENTER_FRAME, loading);

function loading(e:Event):void{

var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;

barra.scaleX = loaded/total;

if (total == loaded){
play();
this.removeEventListener(Event.ENTER_FRAME, loading);
}

}

However, for my big surprise... it didn't work AT ALL.

I thought WTF!? I did exactly the same thing I did on my last game and everything was working fine! What could be the problem?

Well, it came to my attention on a later research that internal preloaders seem to fuck up when your game contains TLF text inside it. Instead of starting on the preloading screen with the bar on it's ZERO state, and gradually filling up, the game automatically uses the ''default'' loader that comes with flash CS6 (five intermitent dots over a black background... yay...). Once that shitty loader finishes... loading, of course, the game FINALLY displays my loader screen... but with the bar fully loaded (of course, the default loader took all the work), rendering my custom preloader useless.

I use TLF text as a way to display all the dialogue that takes place in the game, since it's required that the text changes it's alpha value, scale and some other things on a motion tween (like if it were a graphic symbol, for example).

Now, I'm shocked to know that the only options I've found to get around this issue were: either remove all TLF text (and replace it with something else, IDK) OR create an external preloader SWF... Dear god... It might sound simple for you guys who work with this all day, but both options are a serious problem for me... Changing all TLF text would take EONS to do, and creating an external preloader SWF is way beyond my comprehension... I've looked up for tutorials and such, but even the simpler ones look like total gibberish for me -.-

So, for now... is there a simple way to make MY customized internal preloader work instead of the Flash default "shitty dots" one without having to resort to remove my TLF text nor create an external preloader?

Thanks in advance.

egg82
egg82
  • Member since: Jun. 24, 2006
  • Offline.
Forum Stats
Supporter
Level 05
Game Developer
Response to Preloader problems... save me T_T 2013-01-17 15:24:32 Reply

the Class Factory is useful for AS3 preloaders. Make a new "AS3 with preloader" project in FlashDevelop and see how it works.


Programming stuffs (tutorials and extras)
PM me (instead of MintPaw) if you're confuzzled.
thank Skaren for the sig :P

BBS Signature
Fatelogic
Fatelogic
  • Member since: May. 3, 2012
  • Offline.
Forum Stats
Member
Level 13
Artist
Response to Preloader problems... save me T_T 2013-01-17 15:36:55 Reply

I don't even know what that means/is/works xD

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Preloader problems... save me T_T 2013-01-17 16:43:57 Reply

At 1/17/13 03:36 PM, Fatelogic wrote: I don't even know what that means/is/works xD

:D FlashDevelop is what we use cuz it's nicer and more reliable than Flash Pro, but entirely code-oriented. I think frame 1 is the preloader, frame 2 has all the symbols and sounds in your game anywhere on the stage (so it has something to load), and frame 3 is the game. Then for all symbols, you have to do something with "export on frame _" option under properties, maybe change it to export on frame 2. Maybe...

FD does a lot of that stuff for us, so we forget how it works in FPro
Fatelogic
Fatelogic
  • Member since: May. 3, 2012
  • Offline.
Forum Stats
Member
Level 13
Artist
Response to Preloader problems... save me T_T 2013-01-17 19:07:54 Reply

Thanks for all the help and tips buds. However, I finally found a really simple way to solve it. I just had to set the library publication details as "merge into code". :D

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Offline.
Forum Stats
Supporter
Level 16
Game Developer
Response to Preloader problems... save me T_T 2013-01-17 19:38:43 Reply

At 1/17/13 07:07 PM, Fatelogic wrote: Thanks for all the help and tips buds. However, I finally found a really simple way to solve it. I just had to set the library publication details as "merge into code". :D

Maybe they added that in CS6? I definitely don't remember that; I remember one guy offering $150 to the first person who could do it properly. I guess someone at Adobe wins that