TextPreloader class
as3, class, preloader
Feb 20code3 Comments

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.
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();





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*
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?
Apr 01, 2010 @ 02:47:19
Yahooo.. nice to see people here ^_^
Thx 4 the updates, i’ll update the class