# Popups (flash cs3)

**URL:** <https://forum.kirupa.com/t/popups-flash-cs3/309357>\
**Category:** flash\
**Created:** [May 12, 2010, 7:12pm UTC](https://forum.kirupa.com/t/popups-flash-cs3/309357 "2010-05-12T19:12:30Z")\
**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 12, 2010, 7:12pm UTC](https://forum.kirupa.com/t/popups-flash-cs3/309357/1 "2010-05-12T19:12:30Z")

</div>

I`ve been searching for the answer to this question, which I have a hunch must be an easy one, but I`m not finding the solution! Can anyone here help? I posted in the flash cs3 forum but no replies…  
I’ve set up an xml driven scroll of text items with photo thumbnails, each item when clicked must open up a new url, but (here´s the part I don´t know how to do) the url needs to open in a popup.

Its a pretty standard scroll, here´s the 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]);  
}  
}  
}  
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) \_blank”  
description=“A few words about the article” /\>

etc.
