Hi there
I’m at the end of my tether so if anyone could help me out I would be hugely grateful!
I’m building a photographers gallery and have got this far http://danmauger.com/test/photo/
I’m now at a point where I can’t go forward because of the following problems (code below)
-
The main problem is the ‘ghosting’ between image transitions, you’ll be able to see best when switching between portrait and landscape images. I’ve been trying to solve this for hours but to no avail and I’ve scoured the boards, trying numerous fixes, none of which work.
-
I want to bump the bottom image description on rollover up 10 pixels but again have failed to get my head around how to do this, I know it’s this part of the script
item.onRollOver= function(){
_root.nav.overtxt.text = this.mytitle;
but I’m unsure as to how I define the y coordinate.
3.The same applies to the loading bar, I’d ideally like it to display in the centre of the white bg.
- Finally only a third of the movie displays in mozilla, why would this be?
spacing = 25;
containerMC._alpha = 0;
var pArray = new Array();
var tArray = new Array();
MovieClip.prototype.loadPic = function(pic) {
containerMC._alpha = 0;
cur = pic;
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (t != 0 && Math.round(l/t) == 1 && containerMC._width != 0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h, pic);
bar._visible = 0;
loadText.text = "";
delete this._parent.onEnterFrame;
} else {
bar._width = per;
loadText.text = per+" % ";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
prevb._x = nav._x-5;
nextb._x = nav._x+this._width+5;
nextb._y = prevb._y=this._y-this._height/2;
picinfo._y = nextb._y-5;
picinfo.info.text = tArray[pic];
picinfo._x = border._x-picinfo._width/2;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)-1) {
this._width = w;
this._height = h;
// Kommenteras bort för att slippa centreringen av container
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha += 5;
if (containerMC._alpha>90) {
containerMC._alpha = 100;
containerMC.useHandCursor = 1;
containerMC.onRelease = function() {
if (!menIn) {
if (cur == pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur+1);
}
}
delete this.onEnterFrame;
}
}
}
};
};
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild;
// pathToPics = gallery.attributes.path;
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes*.attributes.title);
pArray.push(gallery.childNodes*.attributes.source);
}
containerMC.loadPic(0);
} else {
title_txt.text = "Error!";
}
// start of new script
for (var b=0; b<gallery.childNodes.length; b++) {
item = _root.nav.attachMovie("itemClip", "itemClip" + b, b);
item._x = 10+24*b;
item._y = 10.0;
item.mytitle=gallery.childNodes**.attributes.title;
item.imagepath=b;
item.onRelease= function(){
_root.containerMC.loadPic(this.imagepath);
}
item.onRollOver= function(){
_root.nav.overtxt.text = this.mytitle;
}
item.onRollOut= function(){
_root.nav.overtxt.text = "";
}
//item.itemLabel.text = menuItem*.attributes.name;
//item.myUrl = menuItem*.attributes.url;
//item.onRelease = function() {
//getURL(this.myUrl,"_blank");
//}
}
//end of new script
};
gallery_xml.load("gallery.xml");
prevb.onRelease = function() {
if (cur == 0) {
containerMC.loadPic(pArray.length-1);
} else {
containerMC.loadPic(cur-1);
}
};
nextb.onRelease = function() {
if (cur == pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur+1);
}
};
I’m sure this is all very simple but I’ve just got back into flash after a long long time and boy have things changed. I love it but it’s also very scary!
Thanks for your time on this, lookforward to hearing your thoughts and saving me from insanity!
Best
Dan
Source files: Click here to download