[ pecooou @ 05.04.2007. 11:32 ] @
Moze li mi neko detaljnije objasniti ovaj kod preloadera? _global.Loader = function(name, depth, x, y, targ) { _root.createEmptyMovieClip(name, depth); _root[name]._x = x; _root[name]._y = y; _root[name].__proto__ = Loader.prototype; _root[name].init(targ); clip = _root[name]; return clip; }; _global.Loader.prototype = new MovieClip(); _global.Loader.prototype.init = function(targ) { this.col = "0xffffff"; this.targ = targ; this.clips = []; this.createTextField("txt", 102, -25, -10, 50, 50); this.tf = new TextFormat(); this.tf.font = "Arial"; this.tf.color = this.col; this.tf.size = 14; this.tf.align = "center"; }; _global.Loader.prototype.onEnterFrame = function() { with (this) { bl = targ.getBytesLoaded(); bt = targ.getBytesTotal(); opr = pr; pr = Math.round((bl*100)/bt); txt.text = pr; txt.setTextFormat(tf); for (i=0; i<(pr-opr); i++) { s = opr+i; this.disp(s); } if (bl == bt) { ani++; x = 1; for (i=0; i<clips.length; i++) { clip = clips; if (i == clips.length/2) { x = -1; } clip._x = clip._x+ani*x*ani; } if (ani == 3) { targ.preloaded = true; delete ani; delete i; delete pr; delete opr; this.removeMovieClip(); } targ.gotoAndPlay(2); } else { targ.gotoAndPlay(2); } } }; _global.Loader.prototype.getI = function() { this.si++; return this.si; }; _global.Loader.prototype.rad = function(d) { this.r = 3.14/180*d; return this.r; }; _global.Loader.prototype.circle = function(pr) { this.lev = this.getI(); this.createEmptyMovieClip("clone"+this.lev, this.lev); this.clip = this["clone"+this.lev]; this.clips.push(this.clip); with (this.clip) { lineStyle(0, _parent.col, 100); beginFill(_parent.col, 100); moveTo(-0.8, 5); lineTo(0.8, 5); lineTo(1.1, -8); lineTo(-1.1, -8); lineTo(-0.8, 5); endFill(); } return this.clip; }; _global.Loader.prototype.disp = function(pr) { this.a = this.circle(pr); this.v = ((pr)*6.28)/100; this.a._rotation = (pr*360)/100; this.a._x = Math.cos(4.71+this.v)*20; this.a._y = Math.sin(4.71+this.v)*20; }; Interesuje me sta radi koja linija. Unapred hvala! |