HEY guys i’m using kirupas reusable preloader and i need to add a colorburn to the pictures…i have the code but i have no idea how to incorporate it into this one…help…plz thanks!
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 10;
} else {
delete this.onEnterFrame;
}
};
};
bar._visible = false;
border2._visible = false;
var empty = this.createEmptyMovieClip("container", "300");
empty._x = 500;
empty._y = 230;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._alpha = 0;
bar._visible = true;
border2._visible = true;
pText._visible = true;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
bar._width = (lBytes/tBytes)*100;
pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
preload.onLoadComplete = function(targetMC) {
container.fadeIn();
border2._visible = false;
bar._visible = false;
dText._visible = false;
trace(targetMC+" finished");
};
//default image
button26.onPress = function() {
my_mc.loadClip("back2.jpg", "container");
};
button27.onPress = function() {
my_mc.loadClip("couch.jpg", "container");
};
button28.onPress = function() {
my_mc.loadClip("curtain.jpg", "container");
};
button29.onPress = function() {
my_mc.loadClip("hugger.jpg", "container");
};
button30.onPress = function() {
my_mc.loadClip("crazy.jpg", "container");
};
button31.onPress = function() {
my_mc.loadClip("headshot.jpg", "container");
};
button32.onPress = function() {
my_mc.loadClip("dracula.jpg", "container");
};
button33.onPress = function() {
my_mc.loadClip("pinup.jpg", "container");
};
button34.onPress = function() {
my_mc.loadClip("heels.jpg", "container");
};
::THE BURN CODE::
dest1 = dest2 = dest3 = dest4 = dest5 = gal1_btn._y;
var tnNr;
spacing = 10;
var curLength;
easeAmount = 3;
MovieClip.prototype.loadPic = function(pic, id) {
delete burn();
info.text = "";
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
if ((l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
container._visible = 0;
border.resizeMe(w, h, id);
delete this.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h, id) {
var speed = 2;
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;
container._x = this._x-this._width/2+spacing/2;
container._y = this._y-this._height/2+spacing/2;
info._y = Math.round(this._y+this._height/2+spacing/2);
if (this._width>=w) {
burn(255);
container._visible = 1;
info.text = id;
delete this.onEnterFrame;
}
}
};
};
[COLOR=red]burn = function(ori) {
this.ori=ori;
this.jj = new Color(container);
this.col = this.jj.getTransform();
this.col.rb = this.col.gb = this.col.bb = this.ori;
this.jj.setTransform(this.col);
this.val = 0;
this.col.aa = 100;
this.onEnterFrame = function() {
if (this.val!=this.col.bb) {
this.col.rb = this.col.gb=this.col.bb += (this.val-this.col.bb)/20;
this.jj.setTransform(this.col);
}else {
delete this.onEnterFrame;
}
[/COLOR]};
};
function galleryChoice(q) {
pArray = new Array();
tArray = new Array();
iArray = new Array();
my_xml = new XML();
container._alpha = 0;
for (var j = 0; j<curLength; j++) {
this.scroll.th_nav["thmb"+j].removeMovieClip();
}
my_xml.ignoreWhite = true;
my_xml.onLoad = function(loaded) {
if (loaded) {
gallery = this.firstChild.childNodes[q];
curLength = gallery.childNodes.length;
for (var i = 0; i<gallery.childNodes.length; i++) {
pArray.push(gallery.childNodes*.attributes.source);
tArray.push(gallery.childNodes*.attributes.thumb);
iArray.push(gallery.childNodes*.attributes.title);
}
}
delay = setInterval(makeButtons, 50);
};
my_xml.load("gallery.xml");
}
function makeButtons() {
tnNr = 0;
clearInterval(delay);
for (var i = 0; i<tArray.length; i++) {
var thb = scroll.th_nav.thmb.duplicateMovieClip("thmb"+i, 1000+i);
thb.id = i;
thb._x = i%3*50;
thb._y = Math.floor(i/3)*50;
}
loadButtons();
}
function loadButtons() {
var tbox = scroll.th_nav["thmb"+tnNr].box;
tbox.loadMovie(tArray[tnNr]);
temp = this.createEmptyMovieClip("tmp"+tnNr, 999);
temp.onEnterFrame = function() {
bt = tbox.getBytesTotal();
bl = tbox.getBytesLoaded();
if (bt == bl && bt>4) {
nextButton();
delete this.onEnterFrame;
}
};
}
function nextButton() {
if (tnNr<tArray.length-1) {
tnNr++;
loadButtons();
} else {
activateButtons();
}
}
function activateButtons() {
mainButtons();
for (var i = 0; i<pArray.length; i++) {
var but = scroll.th_nav["thmb"+i];
but.id = i;
but.onRelease = function() {
container.loadPic(pArray[this.id], iArray[this.id]);
disButtons2(this.id);
}
}
container.loadPic(pArray[0], iArray[0]);
disButtons2(0);
}
butArray = new Array();
butArray = ["gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn", "gal5_btn", "gal6_btn"];
function mainButtons() {
for (var i = 0; i<butArray.length; i++) {
this[butArray*].id = i;
this[butArray*].onRelease = function() {
galleryChoice(this.id);
disButtons(this.id);
}
}
}
function disButtons2(d) {
for (var i = 0; i<tArray.length; i++) {
if (i != d) {
this.scroll.th_nav["thmb"+i].enabled = 1;
this.scroll.th_nav["thmb"+i].box._alpha = 100;
} else {
this.scroll.th_nav["thmb"+i].enabled = 0;
this.scroll.th_nav["thmb"+i].box._alpha = 50;
}
}
}
function disButtons(d) {
for (var i = 0; i<butArray.length; i++) {
if (i != d) {
this[butArray*].enabled = 1;
this[butArray*]._alpha = 100;
} else {
this[butArray*].enabled = 0;
this[butArray*]._alpha = 50;
}
}
}
disButtons(0);
galleryChoice(0);