# Adding a pop-up link into Kirupa Flash gallery

**URL:** <https://forum.kirupa.com/t/adding-a-pop-up-link-into-kirupa-flash-gallery/185480>\
**Category:** flash\
**Created:** [April 13, 2006, 4:43pm UTC](https://forum.kirupa.com/t/adding-a-pop-up-link-into-kirupa-flash-gallery/185480 "2006-04-13T16:43:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![breathe](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@breathe](https://forum.kirupa.com/u/breathe)\
**Post date:** [April 13, 2006, 4:43pm UTC](https://forum.kirupa.com/t/adding-a-pop-up-link-into-kirupa-flash-gallery/185480/1 "2006-04-13T16:43:26Z")

</div>

[LEFT]I got links working in the kirupa gallery script. I am building a portfolio with images and captions, and there are links in the captions (array [4]) that open new browser pages. I would like some of these links to open pop-up windows (the dimension and page links will vary since they are motion films that pop-up). I haven’t been able to get the JS working for the pop ups through the xml and flash files.

I’m not sure what I’m doing wrong, I thought that just adding a javascript header script, and using the regular pop up method would work but it doesn’t. Any ideas? I’ve viewed GetURL methods, but I don’t have a button in Flash, so not sure how to go about.

I appreciate your help. I’m hoping someone knows the answer to this. Does begging for help count? (laugh) Thanks in advance.

\*\*Actionscript

\*\*

> function loadXML(loaded) {  
> if (loaded) {  
> xmlNode = this.firstChild;  
> image = ;  
> description = ;  
> description2 = ;  
> description3 = ;  
> description4 = ;  
> total = xmlNode.childNodes.length;  
> for (i=0; i\<total; i++) {  
> image\* = xmlNode.childNodes\*.childNodes[0].firstChild.nodeValue;  
> description\* = xmlNode.childNodes\*.childNodes[1].firstChild.nodeValue;  
> description2\* = xmlNode.childNodes\*.childNodes[2].firstChild.nodeValue;  
> description3\* = xmlNode.childNodes\*.childNodes[3].firstChild.nodeValue;  
> description4\* = xmlNode.childNodes\*.childNodes[4].firstChild.nodeValue;  
> }  
> firstImage();  
> } else {  
> content = “file not loaded!”;  
> }  
> }  
> xmlData = new XML();  
> xmlData.ignoreWhite = true;  
> xmlData.onLoad = loadXML;  
> xmlData.load(“flash.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();  
> };  
> // ///////////////////////////////////  
> 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\_txt4.html = true;  
> desc\_txt.text = description[p];  
> desc\_txt2.text = description2[p];  
> desc\_txt3.text = description3[p];  
> desc\_txt4.htmlText = description4[p];  
> picture\_num();  
> }  
> }  
> }  
> function prevImage() {  
> if (p\>0) {  
> p–;  
> picture.\_alpha = 0;  
> picture.loadMovie(image[p], 1);  
> desc\_txt4.html = true;  
> desc\_txt.text = description[p];  
> desc\_txt2.text = description2[p];  
> desc\_txt3.text = description3[p];  
> desc\_txt4.htmlText = description4[p];  
> picture\_num();  
> }  
> }  
> function firstImage() {  
> if (loaded == filesize) {  
> picture.\_alpha = 0;  
> picture.loadMovie(image[0], 1);  
> desc\_txt4.html = true;  
> desc\_txt.text = description[0];  
> desc\_txt2.text = description2[0];  
> desc\_txt3.text = description3[0];  
> desc\_txt4.htmlText = description4[0];  
> picture\_num();  
> }  
> }  
> function picture\_num() {  
> current\_pos = p+1;  
> pos\_txt.text = current\_pos+" of "+total;  
> }

\*\* HTML PAGE \*\*includes this:

> ```
> &lt;script language="JavaScript" type="Text/JavaScript"&gt;
> 
> ```

\<!–  
function MM\_openBrWindow(theURL,winName,features) { [//v2.0](https://v2.0)  
window.open(theURL,winName,features);  
}  
//–\>  
\</script\>

\*\* XML FILE (link is array 4, I’ve taken out the other captions for easier reading):\*\*

> ```
> &lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;
> 
> ```

\<images\>  
\<pic\>  
\<link\>\<![CDATA[\<a href=“javascript:;” onClick=“MM\_openBrWindow(‘page.html’,‘’,‘scrollbar s=0,width=700,height=300’)”\>page link\</a\>]]\>\</link\>  
\</pic\>  
\</images\>  
[/LEFT]
