TextPreloader class



3 Comments

Share







Nice old school minimalistic preloader. No assests, no graphics, just an *.as file.
Very easy to include in every project.
The size of the archive is increased due to the huge image included in the test *.fla to simulate preload.


Download source files

Sample:


import com.chargedweb.preloaders.TextPreloader;

var tp:TextPreloader = new TextPreloader();
tp.addEventListener(Event.COMPLETE, stageLoaded);
tp.target = this.loaderInfo; /* set the LoaderInfo target */
tp.preload(); /* do the preload */
addChild(tp);

function stageLoaded(event:Event):void
{
// always perform the gc work
tp.removeEventListener(Event.COMPLETE, stageLoaded);
tp = null;
play();
}
stop();

3 Comments (+add yours?)

  1. Pavel fljot
    Apr 01, 2010 @ 02:33:57

    Those squares are jumping under MacOS (10.5 at least), Arial font helps. If it’s OK under Windows — I suggest to fix it=)
    *скинь что-нибудь на почту, если ответишь, pls*

  2. Pavel fljot
    Apr 01, 2010 @ 02:44:58

    And one more thing. Developers usually use FPS around 31, which makes this preloader run really fast. This workaround can help:

    var j:uint = i * 0.5;
    if(!_sign[j])
    i = j = 0;

    _ts = label.replace(_rs, _pl);
    _ts = _ts.replace(_ra, _sign[j]);

    And that coef “0.5″ can be public var ofcourse… I think that doesn’t make this minimal thing much more complex, but add really usefull feature. m?

  3. jloa
    Apr 01, 2010 @ 02:47:19

    Yahooo.. nice to see people here ^_^
    Thx 4 the updates, i’ll update the class

Leave a Reply

Spam protection by WP Captcha-Free