hola! anyone know how to change the ease in this script? …i need to speed it up a little bit for the transition. Thanks!!
stop();
spacing = 10;
containerMC._alpha = 0;
previewMC._alpha = 0;
var loaded=false
MovieClip.prototype.loadPic = function(pic){
containerMC._alpha = 0
if(!loaded){
//_root.containerMC._alpha = 0;
}else{loaded = true
}
this.loadMovie(pic);
_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 _root.onEnterFrame;
}
}
};
MovieClip.prototype.loadPic2 = function(pic2){
_root.previewMC._alpha = 0;
this.loadMovie(pic2);
_root.onEnterFrame = function(){
var t = previewMC.getBytesTotal(), l = previewMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = previewMC._width + spacing, h = previewMC._height + spacing;
border2.resizeMe2(w, h);
delete _root.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe2 = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
if( Math.abs(this._width-w)<1){
this._width = w;
this._height = h;
_root.previewMC._x = this._x - this._width/2 + spacing/2;
_root.previewMC._y = this._y - this._height/2 + spacing/2;
_root.previewMC._alpha = 100;
delete this.onEnterFrame;
}
}
};
MovieClip.prototype.resizeMe = function(w, h){
var speed = 3;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/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;
delete this.onEnterFrame;
fadeColor(containerMC,normal,20);
}
}
};
normal = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
white = {ra:100, rb:255, ga:100, gb:255, ba:100, bb:255, aa:100, ab:0};
function fadeColor(clip, cto, ease,pic) {
var myColor = new Color(clip), cColor = myColor.getTransform();
// clip.createEmptyMovieClip("baa",100)
clip.onEnterFrame = function() {
var i = 0;
for (var c in cColor) {
cColor[c] += (cto[c]-cColor[c])/ease;
if (Math.abs(cto[c]-cColor[c])>15) {
i++;
}
}
myColor.setTransform(cColor);
if (!i) {
delete this.onEnterFrame;
if(pic){
containerMC.loadPic(pic)
}
}
};
}