# Xml popups almost got it! HELP!

**URL:** <https://forum.kirupa.com/t/xml-popups-almost-got-it-help/309650>\
**Category:** Uncategorized\
**Created:** [May 20, 2010, 9:43pm UTC](https://forum.kirupa.com/t/xml-popups-almost-got-it-help/309650 "2010-05-20T21:43:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panama](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@Panama](https://forum.kirupa.com/u/Panama)\
**Post date:** [May 20, 2010, 9:43pm UTC](https://forum.kirupa.com/t/xml-popups-almost-got-it-help/309650/1 "2010-05-20T21:43:18Z")

</div>

I originally posted this problem at:

> **[how to get xml thumbnails to open popups](https://www.kirupa.com/forum/showthread.php?t=348681)**
>
> Got a web design/development question or just want to hang out with the most awesome people on the planet? Drop on in!

  
The good news is that I have been able to get the urls to open as new windows rather than just replacing what is already on the screen by adding javascript to the getURL order, ie:

item.item\_button.onRelease = function()  
{  
getURL(item\_url[this.\_parent.no],“javascript:NewWindow=window.open(‘newWin’,‘width=100,height=200,left=400,top=400,toolbar=No,location=Yes,scrollbars=No,status=No,resizable=Yes,fullscreen=No’); NewWindow.focus(); void(0);”);  
}  
at this point, however, the windows that open aren’t obeying any of the javascript popup specifications (size, location, scrolls etc.). Does anyone out there know why not?

Here´s the full actionscript:

var item\_title:Array = new Array();  
var item\_url:Array = new Array();  
var item\_description:Array = new Array();  
var total:Number;  
var i:Number = 0;  
var p:Number = 0;  
var item\_spacing:Number = 5;  
var scrolling\_speed:Number = 0.30; // 0.00 to 1.00  
var cv:Number = 0;  
var cv\_old:Number = 0;  
var on\_drag:Boolean;  
var xml:XML = new XML();  
item\_list\_area.\_visible = false;  
item\_list.setMask(item\_mask);  
stop();

xml.onLoad = function()  
{  
item\_list.fm\_item.\_visible = false;  
var nodes = this.firstChild.childNodes;  
total = nodes.length;

for( i = 0; i \< total; i++)  
{  
item\_title\* = nodes\*.attributes.title;  
item\_url\* = nodes\*.attributes.url;  
item\_description\* = nodes\*.attributes.description;  
}  
create\_item\_list();  
scroller();  
}  
xml.load( “Prensa.xml” );  
xml.ignoreWhite = true;  
function create\_item\_list():Void  
{  
for( i = 0; i \< total; i++)  
{  
var item = item\_list.fm\_item.duplicateMovieClip(“fm\_item”+i, i);  
item.\_y = i \* (item\_list.fm\_item.\_height + item\_spacing);  
item.item\_title.text = item\_title\*;  
item.item\_description.text = item\_description\*;  
item.no = i;

item.item\_button.onRelease = function()  
{  
getURL(item\_url[this.\_parent.no],“javascript:NewWindow=window.open(‘newWin’,‘width=100,height=200,left=400,top=400,toolbar=No,location=Yes,scrollbars=No,status=No,resizable=Yes,fullscreen=No’); NewWindow.focus(); void(0);”);  
}  
}  
}  
function scroller():Void  
{  
scroller\_mc.\_y = scrollable\_area\_mc.\_y;  
item\_list.\_y = item\_list\_area.\_y;  
sr = item\_list\_area.\_height/item\_list.\_height;  
scroller\_mc.\_height = scrollable\_area\_mc.\_height \* sr;  
sd = scrollable\_area\_mc.\_height - scroller\_mc.\_height;  
cd = item\_list.\_height - item\_list\_area.\_height;  
cr = cd / sd;

if( item\_list.\_height \<= item\_list\_area.\_height )  
{  
scroller\_mc.\_visible = scrollable\_area\_mc.\_visible = false;  
}  
else  
{  
scroller\_mc.\_visible = scrollable\_area\_mc.\_visible = true;  
}  
scroller\_mc.onPress = function()  
{  
this.startDrag(false, this.\_x, scrollable\_area\_mc.\_y, this.\_x,  
scrollable\_area\_mc.\_y + scrollable\_area\_mc.\_height - this.\_height);  
on\_drag = true;  
this.onEnterFrame = function()  
{  
new\_y = item\_list\_area.\_y + scrollable\_area\_mc.\_y_cr - this.\_y_cr;  
cv = (new\_y - item\_list.\_y) \* scrolling\_speed;  
item\_list.\_y += cv;  
if( on\_drag == false && cv\_old == cv )  
delete this.onEnterFrame;  
cv\_old = cv;  
}  
}  
scroller\_mc.onRelease = scroller\_mc.onReleaseOutside = function()  
{  
this.stopDrag();  
on\_drag = false;  
}  
}

The xml is set up like this:  
\<items\>  
\<item title=“Headline” url=“[http://www.websiteaddress.html](http://www.websiteaddress.html)”  
description=“A few words about the article” /\>

etc.
