Ok, I’ve built an xml gallery with thumbnails only, layed out in a grid (thanks to Stringy’s excellent post), and am trying to link each thumb to a centered popup. I’m getting a centered popup when clicking the image, but instead of the page loading inside, I’m getting an error message:
Not Found
The requested URL /tas-dp_new/undefined was not found on this server.
Here is my actionscript:
cliparray = [];
columns = 6;
spacex =110
spacey=78
/*openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h / 2 + "))+',left='+((screen.width/2)-(" + w / 2 + "))+'" + "')}else{myWin.focus();};void(0);");
};*/
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
link = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
link* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
}
sload()
} else {
content = "file not loaded!";
}
}
function drawSquare(clip, depth, colour, x, y, w, h) {
var mc = clip.createEmptyMovieClip("clip"+depth, depth);
mc._x = x;
mc._y = y;
mc.lineStyle();
mc.beginFill(colour);
mc.lineTo(w, 0);
mc.lineTo(w, h);
mc.lineTo(0, h);
mc.endFill();
return mc;
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images5.xml");
/////////////////////////////////////
var ij=0
function sload() {
for (var i = 0; i<image.length; i++) {
var clip = drawSquare(this, i, 0, 0, 0, 104, 71);
clip._x =71.3+ (i%columns)*spacex;
clip._y =216+ Math.floor(i/columns)*spacey;
var clap =clip.createEmptyMovieClip("tt",1)
clap._x = 2
clap._y = 2
cliparray.push(clap);
clip.pictureValue =i;
clip.onRollOver = function() {
this._alpha = 75;
};
clip.onRollOut = function() {
this._alpha = 100;
};
//this is where I'm trying to get the popup
clip.onRelease = function() {
getURL("javascript:Launch('" + link[p] + "',650,574)");
};
}
startload()
}
this.createEmptyMovieClip("checker",1000)
function checkload() {
checker.onEnterFrame = function() {
if (cliparray[ij]._width) {
delete this.onEnterFrame;
if (ij<cliparray.length-1) {
ij++;
startload();
}
}
};
}
function startload() {
cliparray[ij].loadMovie(image[ij]);
checkload();
}
Here is what my XML nodes look like:
<pic>
<image>thumbnails2/videos/juvenile.jpg</image>
<link>movies/music_videos/juvenile.htm</link>
</pic>
(And yes, I’ve tried these as absolute references as well)
And I have this code in the head of my html doc for the popups:
<script language="JavaScript">
function Launch(page, width, height) {
OpenWin = window.open(page, "video", "toolbar=no, menubar=no ,location=no, scrollbars=no, resizable=no, width=" + width + ", height=" + height + ", top=" + (screen.height/2 - height/2) + ", left=" + (screen.width/2 - width/2) + "\"");
}
</script>
Anyone know where I’m getting stuck?
:cross-eye