PRELOAD THIS
- Started
- Last post
- 6 Responses
- thedistrict
I need a decent preloader. Been to flashkit and others... they are all crap. Any suggestions where I can get a good one, nice and simple.... cheers
- chossy0
why not get the code for a preloader then now this might sound mad but make your own?....
- Timson0
i hope this code will survive in here. it's a 100% AS 2.0 based preloader. works like a charm and easy to customize. here we go:
// preloader
var barWidth:Number = 200;
var barHeight:Number = 6;this.createEmptyMovieClip("pBar... 9999);
var bar:MovieClip = pBar_mc.createEmptyMovieClip("ba... 10);
bar.beginFill(0x9C0059, 100);
bar.moveTo(0, 0);
bar.lineTo(barWidth, 0);
bar.lineTo(barWidth, barHeight);
bar.lineTo(0, barHeight);
bar.lineTo(0, 0);
bar.endFill();
bar._xscale = 0;var stroke:MovieClip = pBar_mc.createEmptyMovieClip("st... 20);
stroke.lineStyle(0, 0x9C0059);
stroke.moveTo(0, 0);
stroke.lineTo(barWidth, 0);
stroke.lineTo(barWidth, barHeight);
stroke.lineTo(0, barHeight);
stroke.lineTo(0, 0);
//
var text_fmt:TextFormat = new TextFormat();
text_fmt.font = "Savoye";
text_fmt.size = 28;
text_fmt.color = 0x9C0059;
//
//
pBar_mc.createTextField("label_t... 30, 0, barHeight+5, 150, 30);
pBar_mc.label_txt.autoSize = true;
pBar_mc.label_txt.selectable = false;
pBar_mc.label_txt.embedFonts = true;
pBar_mc.label_txt.selectable = false;
pBar_mc.label_txt.setNewTextForm...
pBar_mc.label_txt.multiline = false;
pBar_mc.label_txt.wordWrap = false;pBar_mc._x = (Stage.width - pBar_mc._width) / 2;
pBar_mc._y = (Stage.height - pBar_mc._height) / 2;var my_xml:XML = new XML();
my_xml.ignoreWhite = true;
my_xml.onLoad = function(success:Boolean) {
pBar_mc.onEnterFrame = undefined;
if (success) {
trace("XML loaded successfully");
} else {
trace("Unable to load XML");
}
};
my_xml.load("http://www.helpexam...pBar_mc.onEnterFrame = function() {
var pctLoaded:Number = Math.floor(_root.getBytesLoaded... / _root.getBytesTotal() * 100);
if (!isNaN(pctLoaded)) {
pBar_mc.bar_mc._xscale = pctLoaded;
pBar_mc.label_txt.text = "Loading intro " + pctLoaded + "%";
if (pctLoaded >= 100) {
pBar_mc.onEnterFrame = undefined;
_root.gotoAndPlay("begin");
pBar_mc._visible = false;
}
}
};
- rson0
to preload a static .swf? meaning no xml or any of that stuff
- rson0
very simple,
actBytes = myTarget.getBytesLoaded() || 0;
totBytes = myTarget.getBytesTotal() || 100;
percent = Math.round(actBytes * 100 / totBytes);if( totBytes - actBytes > 10){
bar._xscale = percent;
gotoAndPlay(2)
}
- rson0
tim you should hook that up so it preloads the xml as well