space = 10; photo_mc._alpha = 0; MovieClip.prototype.loadPhoto = function(photo){ photo_mc._alpha = 0; this.loadMovie(photo); _level0.onEnterFrame = function(){ var total = Math.round(photo_mc.getBytesTotal()/1024); var loaded = Math.round(photo_mc.getBytesLoaded()/1024); if (total != 0 && loaded>=total){ var w = photo_mc._width + space; var h = photo_mc._height + space; border.resize(w, h); delete this.onEnterFrame; } } }; MovieClip.prototype.resize = function(w, h){ var speed = 4; this.onEnterFrame = function(){ this._width += (w - this._width)/speed; this._height += (h - this._height)/speed; if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){ this._width = w; this._height = h; photo_mc._x = this._x - this._width/2 + space/2; photo_mc._y = this._y - this._height/2 + space/2; photo_mc._alpha = 100; delete this.onEnterFrame; } } }; life.l1.onRelease = function() { photo_mc.loadPhoto("/pics/l1.jpg"); }; life.l2.onRelease = function() { photo_mc.loadPhoto("/pics/l2.jpg"); }; life.l3.onRelease = function() { photo_mc.loadPhoto("/pics/l3.jpg"); }; life.l4.onRelease = function() { photo_mc.loadPhoto("/pics/l4.jpg"); }; life.l5.onRelease = function() { photo_mc.loadPhoto("/pics/l5.jpg"); }; life.l6.onRelease = function() { photo_mc.loadPhoto("/pics/l6.jpg"); }; life.l7.onRelease = function() { photo_mc.loadPhoto("/pics/l7.jpg"); }; function init(photo) { photo_mc.loadPhoto(photo); } init("/pics/l1.jpg");