Pop Up with Flash?

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 :frowning:
If you have some links to help me, I take !!


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

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.

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(); }

put these code to your flash button:

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

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 !

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

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 :

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

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

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 :

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:

HTML file is:

<title>flash page</title>
<script language="JavaScript" type="text/JavaScript">
function OpenBrWindow(theURL,winName,features) { //v2.0

than add the following to your flash button:


‘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 :slight_smile: )

thanks for discribing virusescu :wink:

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 ’ !! :slight_smile:
that’s like this now :


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 :

<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

(I don’t paste the body…)

Where is the error ?? don’t see… sorry :frowning:

If you want, you can see my website, with the no-pop up…
at 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… :slight_smile: