Linking thumbnail to desc_txt named html

Hi,
I know i ask more question. someone will kick me :slight_smile:

I use kirupa thumbnailed pic codes. And i add some extra codes there. I want to open pop up window when I clicked to thumbnail pics. But each pic i want to open different html in this pop up.( example when i clicked to boston.jpg - boston.html will get opened in pop up. Maybe name will be chosen from desc_txt MC.)
I configure the codes and now i can open pop-up window. But couldnt open different pop-ups:)

I attached the codes and coloured the text that i add with blue. And I couldnt configure the red part :stuck_out_tongue:

I hope i am clear to be understood.

thanks


function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
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;
thumbnails_fn(i);

}
firstImage();
} else {
content = “file not loaded!”;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“images.xml”);
/////////////////////////////////////

[COLOR=blue]_root.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);”);
}[/COLOR]

/////////////////////////////////////
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();
};

/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}

[COLOR=blue]function popUp() {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
[COLOR=red] if (p<(total-1)) {
p++;
desc_txt.text = description[p];

address = desc_txt.text.html; // I have problem here i think[/COLOR]
target_winName = “kirupa”;
width = 751;
height = 364;
toolbar = 0;
location = 1;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 0;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
}
[/COLOR]function prevImage() {
if (p>0) {
p–;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function thumbNailScroller() {
// thumbnail code!
this.createEmptyMovieClip(“tscroller”, 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
thumbnail_mc._x -= scroll_speed;
} else if ((_root._xmouse<=(hit_left._x+40)) && (thumbnail_mc.hitTest(hit_left))) {
thumbnail_mc._x += scroll_speed;
}
} else {
delete tscroller.onEnterFrame;
}
};
}
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip(“t”+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = hit_left._x+(target_mc._width+10)*k-thumbnail_mc._x;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
popUp();
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
thumbNailScroller();
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], “thumbnail_mc.t”+k);
}

i need to do this in short time… need help :slight_smile:

Post fla please instead of writing entire code here.
It looks clumsy.

It should be as below

ActionScript Code:

[FONT=Courier New][LEFT]
address = desc_txt.[COLOR=#0000ff]text[/COLOR]+[COLOR=#ff0000]".html"[/COLOR]; [COLOR=#808080]// you needed to append “.html” string.[/COLOR]

[/LEFT]

[/FONT]

desc_txt.text.".html" … gives fault sites. I clicked second pic it opens third or I clicked third it opens second again.

can i open external .swf with thias logic.
_root.film.loadMovie(desc_txt.text+".swf");

I send the fla… with attachment

I solved the problem. with.

function ferdi() {
if (p<(total-1)) {
p++;
links_txt.text = links[p];
this.film.loadMovie(links_txt.text);
}
}
ı create a link on .xml page. and ı can call it with thumbnails.

But now I want to see desc_text when ı rollover the thumbs… I couldnt do this :slight_smile: