# (FMX04) making a pop-up window button inside a movie clip

**URL:** <https://forum.kirupa.com/t/fmx04-making-a-pop-up-window-button-inside-a-movie-clip/191222>\
**Category:** flash\
**Created:** [June 18, 2006, 9:40pm UTC](https://forum.kirupa.com/t/fmx04-making-a-pop-up-window-button-inside-a-movie-clip/191222 "2006-06-18T21:40:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aubtin](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@aubtin](https://forum.kirupa.com/u/aubtin)\
**Post date:** [June 18, 2006, 9:40pm UTC](https://forum.kirupa.com/t/fmx04-making-a-pop-up-window-button-inside-a-movie-clip/191222/1 "2006-06-18T21:40:42Z")

</div>

Hello all.

I may very well be pushing my luck here but…

I have, with the greatly apprectiated help of ieatcotton, created a scene with randomly moving movie clips using:

onClipEvent (load) {  
//data you may want to change  
xstart = 0;  
ystart = 125;  
width = 600;  
height = 220;  
speed = Math.round(Math.random()\*2)+1;  
//initial positions  
x = 567.8;  
y = 316.6;  
x\_new = (Math.random()\*width)+xstart;  
y\_new = (Math.random()_height)+ystart;  
}  
onClipEvent (enterFrame) {  
//x movement  
if (x\_new\>this.\_x) {  
sign\_x = 1;  
} else {  
sign\_x = -1;  
}  
dx = Math.abs(x\_new-this.\_x);  
if ((dx\>speed) || (dx\<-speed)) {  
this.\_x += sign\_x_speed;  
} else {  
x\_new = (Math.random()_width)+xstart;  
}  
//y movement  
if (y\_new\>this.\_y) {  
sign\_y = 1;  
} else {  
sign\_y = -1;  
}  
dy = Math.abs(y\_new-this.\_y);  
if ((dy\>speed) || (dy\<-speed)) {  
this.\_y += sign\_y_speed;  
} else {  
y\_new = (Math.random()\*height)+ystart;  
}  
}

Inside these movie clips I have a button that I would like to make open a pop-up window. I have tried using the code from tutorial [http://www.kirupa.com/developer/mx/centered\_popup.htm](http://www.kirupa.com/developer/mx/centered_popup.htm)

but am having no joy at all.

Can this be done? And if so, if anyone could help me out I would be so grateful. I am definitely out of my depth here!

Thank you!  
aubtin
