# Pop Up with Flash?

**URL:** <https://forum.kirupa.com/t/pop-up-with-flash/118326>\
**Category:** Uncategorized\
**Created:** [August 4, 2004, 3:05pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326 "2004-08-04T15:05:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![froggyVerte](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@froggyVerte](https://forum.kirupa.com/u/froggyVerte)\
**Post date:** [August 4, 2004, 3:05pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/1 "2004-08-04T15:05:04Z")

</div>

hello everybody !

In my Flash Animation, I have a button. I would like that he opened a pop up…

Is it possible to create a pop up with Flash ? And how ?  
Could we use Javascript function in Flash ? And how ?  
I know the method with dreamweaver…:hangover:

Please help me ☹  
If you have some links to help me, I take !!

---

<div class="post-metadata">

**Author:** ![2nd\_day](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2nd\_day](https://forum.kirupa.com/u/2nd_day)\
**Post date:** [August 4, 2004, 3:17pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/2 "2004-08-04T15:17:53Z")

</div>

[http://www.moock.org/webdesign/flash/fscommand/](http://www.moock.org/webdesign/flash/fscommand/)

here is explained how to use flash with javascript… i think you will be helped with this piece of text.

---

<div class="post-metadata">

**Author:** ![e\_s\_x\_s](https://avatars.discourse-cdn.com/v4/letter/e/f9ae1b/32.png) [@e\_s\_x\_s](https://forum.kirupa.com/u/e_s_x_s)\
**Post date:** [August 4, 2004, 3:28pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/3 "2004-08-04T15:28:44Z")

</div>

u can use javascript in flash like :

getURL(“javascript:window.close”); but if you use quotes in the javascript, u must add \ in front of the "…

yes u can create a PopUp;

add below code to your \<head\> tag in the html file.

[AS]  
function popup(url, myname, w, h, scroll)  
{  
var winl = (screen.width - w) / 2;  
var wint = (screen.height - h) / 2;  
winprops = ‘height=’+h+’,width=’+w+’,top=’+wint+’,left=’+winl+’,scrollbars=’+scroll  
win = window.open(url, myname, winprops)  
if (parseInt(navigator.appVersion) \>= 4) { win.window.focus(); }  
}  
[/AS]

put these code to your flash button:

```auto

on(press){
getURL("javascript:popup(this.href,'name','400','400','no');return false;");
}

```

---

<div class="post-metadata">

**Author:** ![froggyVerte](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@froggyVerte](https://forum.kirupa.com/u/froggyVerte)\
**Post date:** [August 5, 2004, 2:12pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/4 "2004-08-05T14:12:19Z")

</div>

thanx for your answers…(-:  
2nd day, your link is good, but my english is so :h: (i’m french !) there are a lot of strange words for me.:puzzled:  
e.s.x.s, i will try now your advises… after, i 'll say you if it work !!

thanx again !

---

<div class="post-metadata">

**Author:** ![2nd\_day](https://avatars.discourse-cdn.com/v4/letter/2/a4c791/32.png) [@2nd\_day](https://forum.kirupa.com/u/2nd_day)\
**Post date:** [August 5, 2004, 2:24pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/5 "2004-08-05T14:24:04Z")

</div>

maybe this link (it’s french! [http://www.flashkod.com/code.aspx?ID=13967](http://www.flashkod.com/code.aspx?ID=13967))

---

<div class="post-metadata">

**Author:** ![froggyVerte](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@froggyVerte](https://forum.kirupa.com/u/froggyVerte)\
**Post date:** [August 5, 2004, 3:06pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/6 "2004-08-05T15:06:01Z")

</div>

sorry to learn you that it doesn’t work. :jail:

i’ll try with e.s.x.s method, but : or nothing happens (with the word for word code…) or it works like now (the pop up is not a pop up, the page is big !)  
i’ll try with the link you give me, 2nd day, but i don’t understand some things…  
their code is very similar than e.s.x.s. code…

maybe it’s my fault because I don’t understand all in the coding… it’s new for me.

* * *

the name of my html page : SoundDesignAEcouter.htm  
in my AS button, do I say anywhere this name ???  
in :

on(press){  
getURL(“javascript:popup(this.href,‘name’,‘400’,‘400’,‘no’);return false;”);  
}

* * *

i’ll try to replace ‘name’ by ‘SoundDesignAEcouter.htm’, like this :

on(press){  
getURL(“javascript:popup(this.href,‘SoundDesignAEcouter.htm’,‘400’,‘400’,‘no’);return false;”);  
}

## \>\> doesn’t work

## And do I replace the values (‘400’,‘400’) by the size of my pop up ? \>\> 360x264. ???

i’ll try this to :

on(press){  
getURL(“SoundDesignAEcouter.htm”,\_blank);  
getURL(“javascript:popup(this.href,‘name’,‘400’,‘400’,‘no’);return false;”);  
}

## \>\> it opens my window, but not in a pop up !!!

thanx for your future help…:puzzled:

---

<div class="post-metadata">

**Author:** ![e\_s\_x\_s](https://avatars.discourse-cdn.com/v4/letter/e/f9ae1b/32.png) [@e\_s\_x\_s](https://forum.kirupa.com/u/e_s_x_s)\
**Post date:** [August 6, 2004, 1:15am UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/7 "2004-08-06T01:15:32Z")

</div>

HTML file is:

```auto

<html>
<head>
<title>flash page</title>
<script language="JavaScript" type="text/JavaScript">
function OpenBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
</script>
</head> 
<body><body>
<html>

```

than add the following to your flash button:

```auto

on(press){
getURL(javascript:OpenBrWindow('YOURS.htm','sound','width=300,height=300'));
}

```

---

<div class="post-metadata">

**Author:** ![virusescu](https://avatars.discourse-cdn.com/v4/letter/v/8edcca/32.png) [@virusescu](https://forum.kirupa.com/u/virusescu)\
**Post date:** [August 6, 2004, 7:40am UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/8 "2004-08-06T07:40:54Z")

</div>

‘name’ is an identifier javascript assigns to a new oppen window. So your link as esxs said should go as the first parameter (at least in that function 🙂 )

---

<div class="post-metadata">

**Author:** ![e\_s\_x\_s](https://avatars.discourse-cdn.com/v4/letter/e/f9ae1b/32.png) [@e\_s\_x\_s](https://forum.kirupa.com/u/e_s_x_s)\
**Post date:** [August 6, 2004, 8:11am UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/9 "2004-08-06T08:11:13Z")

</div>

thanks for discribing virusescu 😉

---

<div class="post-metadata">

**Author:** ![froggyVerte](https://avatars.discourse-cdn.com/v4/letter/f/f4b2a3/32.png) [@froggyVerte](https://forum.kirupa.com/u/froggyVerte)\
**Post date:** [August 6, 2004, 3:41pm UTC](https://forum.kirupa.com/t/pop-up-with-flash/118326/10 "2004-08-06T15:41:27Z")

</div>

thanx e.s.x.s, but… mmmmhhh… :h:  
I try your new codes and it doesn’t want to work…

I repair the AS code… you forgot some " and some ’ !! 🙂  
that’s like this now :

* * *

## on(press){ getURL(“javascript:OpenBrWindow(‘SoundDesignAEcouter.htm’,‘sound’,‘width=300’,‘height=300’);”); }

Is the html code ok ???

When I open my html page, the navigator said me “error on the page”. it opens nothing. where is my page ??? :d:

I copy-paste my html code :

* * *

## \<html\> \<head\> \<title\>:: Amanite Graphoïde Website 2004 ::\</title\> \<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”\> \<script language=“JavaScript” type=“text/JavaScript”\> function OpenBrWindow(theURL,winName,features) { [//v2.0](https://v2.0) window.open(theURL,winName,features); } \</script\> \</head\>

(I don’t paste the body…)

Where is the error ?? don’t see… sorry ☹

If you want, you can see my website, with the no-pop up…  
at [http://www.amanite-graphoide.tk](http://www.amanite-graphoide.tk)  
when you are in the website, go to the “sound design” menu. you can see the flash file (pict with the big word “sound design”). this is an external swf called in the main swf…  
when you click on the button “écouter”, an html file (with a flash animation) open. That’s this html file that I want to be a pop-up… with the size : 360px x 264px.

thanx virusescu. that’s what I thinked… 🙂
