# Linking thumbnail to desc\_txt named html

**URL:** <https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560>\
**Category:** Uncategorized\
**Created:** [March 19, 2006, 1:50pm UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560 "2006-03-19T13:50:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferdibulbul](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@ferdibulbul](https://forum.kirupa.com/u/ferdibulbul)\
**Post date:** [March 19, 2006, 1:50pm UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560/1 "2006-03-19T13:50:52Z")

</div>

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

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 😛

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

---

<div class="post-metadata">

**Author:** ![ferdibulbul](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@ferdibulbul](https://forum.kirupa.com/u/ferdibulbul)\
**Post date:** [March 21, 2006, 7:08am UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560/2 "2006-03-21T07:08:09Z")

</div>

i need to do this in short time… need help 🙂

---

<div class="post-metadata">

**Author:** ![kernel\_flash](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kernel\_flash](https://forum.kirupa.com/u/kernel_flash)\
**Post date:** [March 21, 2006, 7:13am UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560/3 "2006-03-21T07:13:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kernel\_flash](https://avatars.discourse-cdn.com/v4/letter/k/a87d85/32.png) [@kernel\_flash](https://forum.kirupa.com/u/kernel_flash)\
**Post date:** [March 21, 2006, 7:14am UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560/4 "2006-03-21T07:14:58Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![ferdibulbul](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@ferdibulbul](https://forum.kirupa.com/u/ferdibulbul)\
**Post date:** [March 21, 2006, 12:15pm UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560/5 "2006-03-21T12:15:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ferdibulbul](https://avatars.discourse-cdn.com/v4/letter/f/48db29/32.png) [@ferdibulbul](https://forum.kirupa.com/u/ferdibulbul)\
**Post date:** [March 22, 2006, 3:48pm UTC](https://forum.kirupa.com/t/linking-thumbnail-to-desc-txt-named-html/182560/6 "2006-03-22T15:48:19Z")

</div>

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 🙂
