Hi i got a prototype that i wanna adjust so it will first animate the height, then the width…
Original prototype:
MovieClip.prototype.loadPic = function(pic){
delete enter();
_root.containerMC._alpha = 0;
this.loadMovie(pic);
enter = _root.onEnterFrame = function(){
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = containerMC._width + spacing, h = containerMC._height + spacing;
border.resizeMe(w, h);
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 9;
this.onEnterFrame = function(){
this._height += (h - this._height)/speed;
this._width += (w - this._width)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
_root.closebtn._y = _root.containerMC._y - 12
_root.closebtn._x = _root.containerMC._x + _root.containerMC._width - 30
_root.closebtn._visible = 1;
delete this.onEnterFrame;
}
}
};
Ive tried this:
MovieClip.prototype.resizeMe = function(w, h){
var speed = 9;
this.onEnterFrame = function(){
this._height += (h - this._height)/speed;
***if (this._height == containerMC._height){
this._width += (w - this._width)/speed;
}***
if( Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
_root.containerMC._x = this._x - this._width/2 + spacing/2;
_root.containerMC._y = this._y - this._height/2 + spacing/2;
_root.containerMC._alpha = 100;
_root.closebtn._y = _root.containerMC._y - 12
_root.closebtn._x = _root.containerMC._x + _root.containerMC._width - 30
_root.closebtn._visible = 1;
delete this.onEnterFrame;
}
}
};
This doesnt animate it tho, im still pretty new to AS so i probably wont get it to work on my own. :-/
Id really appreciate any help. :beam:
Thanks
- Duck.