# Help with pop-up window

**URL:** <https://forum.kirupa.com/t/help-with-pop-up-window/183072>\
**Category:** Uncategorized\
**Created:** [March 23, 2006, 4:30pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072 "2006-03-23T16:30:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![o111](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/o111/32/2123_2.png) [@o111](https://forum.kirupa.com/u/o111)\
**Post date:** [March 23, 2006, 4:30pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/1 "2006-03-23T16:30:27Z")

</div>

Whatsup?

I’m making a site and on the site I’ve got a contact button.  
I want a pop-up window to appear when my visitors click on the button.  
I don’t mean a new window on their browser, but just a window on the flash site.

What code do I use so the window appear when the button is clicked? I don’t want it to change to another frame in the timeline. Just a window popping up in the same frame. And I want a close button on the window so when that button is clicked you’ll just close the window without going to a new frame.

Hope you got it! I’ll try to illustrate it with some images if you don’t understand;) Thanks:D

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [March 23, 2006, 4:41pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/2 "2006-03-23T16:41:19Z")

</div>

You need to attach a MovieClip.

1. Make the “window”, press F8 to make it a MovieClip, then delete it form the stage so it’s still in your library
2. right click on it in the library and click “linkage”, then click “export for actionscript”. Give it a good identifier name.  
3.then in the main movie, put this code on the button:

```auto
on (release){
   attachMovie("linkageidentifier", "somename", getNextHighestDepth());
}

```

(replace “linkageidentifier” with the name you gave it. “somename” is the instance name for it, you can use this the refer to this clip later)

---

<div class="post-metadata">

**Author:** ![o111](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/o111/32/2123_2.png) [@o111](https://forum.kirupa.com/u/o111)\
**Post date:** [March 23, 2006, 6:01pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/3 "2006-03-23T18:01:41Z")

</div>

Thanks! that worked fine:D  
But what code do I write on the “close” button on the “window”?  
So the “window” disapears. And how do I decide the position of the “window”? Now it just appears over the contact-button. I want it to appear someplace else.

Thanks alot:)

---

<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 24, 2006, 8:30am UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/4 "2006-03-24T08:30:39Z")

</div>

great job…

but it is not movable.  
if ı want to move it somewhere inside explorer with mouse?

---

<div class="post-metadata">

**Author:** ![o111](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/o111/32/2123_2.png) [@o111](https://forum.kirupa.com/u/o111)\
**Post date:** [March 24, 2006, 11:50am UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/5 "2006-03-24T11:50:37Z")

</div>

forget it. thats not so important, the location of the window I mean.

But how do I close the window again? I’ve got a close button in the same movieclip as the window. And what code do I use so I can close the window and sort of send it back to the library so it disappears?  
Is there a code instead of this:

on (release){  
attachMovie(“linkageidentifier”, “somename”, getNextHighestDepth());  
}

-that sort of detach the movie? Something like this?:

on (release){  
detachMovie(“linkageidentifier”, “somename”, getNextHighestDepth());  
}

I don’t want the window there all the time of course…

---

<div class="post-metadata">

**Author:** ![o111](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/o111/32/2123_2.png) [@o111](https://forum.kirupa.com/u/o111)\
**Post date:** [March 24, 2006, 4:16pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/6 "2006-03-24T16:16:35Z")

</div>

Please! I really need to know this one guys;)

---

<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 24, 2006, 8:08pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/7 "2006-03-24T20:08:45Z")

</div>

you can do the same with “loadMovie” function. And when you want to close winndow. you can use unload() function…

that’s all i think. … you dont need to use this attachmovie function… it is silly i think…

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [March 24, 2006, 8:13pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/8 "2006-03-24T20:13:23Z")

</div>

Ummm… loadmovie is for loading external clips, not things in the library.

I was not replying in hopes that he might crack open the Flash help and realize it is a great resource. Heres a little hint:  
[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary578.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary578.html)

---

<div class="post-metadata">

**Author:** ![o111](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/o111/32/2123_2.png) [@o111](https://forum.kirupa.com/u/o111)\
**Post date:** [March 24, 2006, 11:51pm UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/9 "2006-03-24T23:51:23Z")

</div>

thanks guys!

---

<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 26, 2006, 10:02am UTC](https://forum.kirupa.com/t/help-with-pop-up-window/183072/10 "2006-03-26T10:02:06Z")

</div>

ok. thanks defective…
