i was wondering if anyone could help me im using the moviecliploader for the first time and my border resize isnt workin:
var spacing:Number = 20;
picture._alpha = 0;
preloader._alpha = 0;
MovieClip.prototype.loadPic = function(pic:String):Void {
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
target_mc.startTimer = getTimer();
preloader.what.text = "No:"+p;
preloader._alpha = 100;
picture._alpha = 0;
picture.stop();
};
mclListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
trace(target_mc+".onLoadProgress with "+bytesLoaded+" bytes of "+bytesTotal);
preloader.preload_bar._xscale = 100*bytesLoaded/bytesTotal;
target_mc._alpha += 10;
};
mclListener.onLoadComplete = function(target_mc:MovieClip):Void {
target_mc.completeTimer = getTimer();
preloader.what.text += "LOADING OF "+target_mc+" COMPLETE"+newline;
picture._alpha = 100;
preloader._alpha = 0;
//picture.gotoAndPlay(2);
var w:Number = picture._width+spacing, h:Number = picture._height+spacing;
picture._y = border._y+10;
picture.onEnterFrame = border.resizeMe(w, h);
target_mc.onPress = function() {
preloader.what.text += newline+"target_mc = "+target_mc._name;
};
};
mclListener.onLoadInit = function(target_mc:MovieClip):Void {
var timerMS:Number = target_mc.completeTimer-target_mc.startTimer;
target_mc.createTextField("timer_txt", target_mc.getNextHighestDepth(), 0, target_mc._height, target_mc._width, 22);
target_mc.timer_txt.text = "loaded in "+timerMS+" ms.";
var t:Number = picture.bytesTotal(), l:Number = picture.bytesLoaded();
};
var image_mccl:MovieClipLoader = new MovieClipLoader();
image_mccl.addListener(mclListener);
image_mccl.loadClip(pic, picture);
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
yy = picture._height;
var w = picture._width+spacing, h = picture._height+spacing;
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
mks._width += (w-mks._width)/speed;
hit_left._x += (w-this._width)/speed;
keepup._width += (w-this._width)/speed;
keepup._x = this._x-(this._width/2);
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
picture._x = this._x-this._width/2+spacing/2;
picture._y = this._y+10;
trace(this);
msk._width = w-spacing;
msk._height = h-13;
msk._x = this._x;
msk._y = this._y;
hit_left._x = this._x-(this._width/2)+7;
mks._width = w-32;
mks._x = this._x;
//}
}
};
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
link = [];
info = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[3].firstChild.nodeValue;
info* = xmlNode.childNodes*.childNodes[4].firstChild.nodeValue;
thumbnails_fn(i);
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
preloader.what.text = "XML";
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
var p:Number = 0;
function nextImage() {
//if (loaded == filesize && filesize != 0) {
//if (picture._alpha>=100) {
//this.onEnterFrame = function() {
//picture._alpha = picture._alpha-20;
//preloader._alpha = preloader._alpha+20;
//if (picture._alpha<=0 && preloader._alpha>=100) {
picture.stop();
if (p<(total-1)) {
p++;
picture.loadPic(image[p]);
ino.desc_txt.text = description[p];
ino.dino.htmltxt.text = info[p];
picture_num();
}
//}
//};
//};
//}
}
function prevImage() {
if (p>0) {
p--;
picture.loadPic(image[p]);
ino.desc_txt.text = description[p];
ino.dino.htmltxt.text = info[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture.loadPic(image[0]);
ino.desc_txt.text = description[0];
cap.desc.text = " "+link[0];
ino.dino.htmltxt.text = info[0];
picture_num();
thumbnail_mc.attachMovie("thumb2", "tt"+0, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.tt0.gotoAndStop(2);
}
}
function picture_num() {
var current_pos:Number = p+1;
ino.pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
var scroll_speed:Number = 10;
tscroller.onEnterFrame = function() {
if ((_ymouse>=thumbnail_mc._y) && (_ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
_x;
} else if ((_xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
var k:Number = 0;
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
var tlistener:Object = new Object();
tlistener.onLoadStart = function(target_mc:MovieClip) {
target_mc._alpha = 0;
};
tlistener.onLoadStart = function(target_mc:MovieClip) {
target_mc._alpha = 0;
};
tlistener.onLoadProgress = function(target_mc:MovieClip) {
target_mc._alpha += 10;
//preloader.preload_bar._xscale = bytesLoaded/bytesTotal;
};
tlistener.onLoadComplete = function(target_mc:MovieClip) {
target_mc._alpha = 100;
thumbnail_mc.attachMovie("thumb2", "tt"+k, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.attachMovie("thumb", "test"+k, thumbnail_mc.getNextHighestDepth());
preloader.what.text = k+"thumbs";
var kl:Number = k+1;
if (kl eq total) {
preloader.what.text = "Done!";
}
};
tlistener.onLoadInit = function(target_mc:MovieClip) {
target_mc._x = (target_mc._width+5)*k;
var po:MovieClip = eval("thumbnail_mc.tt"+k);
var poo:MovieClip = eval("thumbnail_mc.test"+k);
var poop:MovieClip = eval("thumbnail_mc.t"+k);
poo._x = (poop._width+5)*k;
poo.tover.tname.text = ">"+" No: "+k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
poo.tover.tname.text = ">"+" No: "+k;
poo.gotoAndStop(4);
p = this.pictureValue-1;
po._x = (po._width+5)*k;
po._x = this._x;
po.gotoAndStop(2);
trace(po);
nextImage();
preloader.what.text = "No:"+k;
};
target_mc.onRollOver = function() {
poo.gotoAndStop(2);
poo.tover.tname.text = ">"+" No: "+k;
thumbNailScroller();
captionFN(true, description[k], this);
};
target_mc.onRollOut = function() {
poo.gotoAndStop(3);
poo.tover.tname.text = ">"+" No: "+k;
captionFN(false);
};
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
captionFN = function (showCaption, captionText, bName) {
if (showCaption && loaded == filesize) {
cap.gotoAndPlay(1);
cap.crap.setMask(cap.msk);
cap.msk.gotoAndPlay(1);
createEmptyMovieClip("hoverCaption", this.getNextHighestDepth());
cap.desc.text = " "+captionText;
cap.crap._width = 6*cap.desc.text.length;
cap._alpha = 100;
if ((bName._width+bName._x+cap._width)>border.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
cap._x = _xmouse+xo;
cap._y = _ymouse+yo;
cap._visible = true;
};
} else {
cap.gotoAndPlay(14);
delete hoverCaption.onEnterFrame;
}
};
stop();