You mean like a pop-up window with a close window link inside that window?
If so, I have included the popular pop up window text file I wrote for someone else on this forum that needed to know how to do it. That will teach you how to create a pop-up window.
as for closing a window it goes like this…
<A HREF="javascript:close();">Close Window</A>
PS: I am moving this to the HTML/Javascript forum…
on the button action itself. I am only opening swf file’ that are not contained in html. Do I create a button as with the others and as for the action of that button put that line of code. Also, is this PHP?
This is javascript. What Im looking for is a way to close a window from within an swf movie.
Are you testing this in Flash or on the Published HTML page? If you test from inside Flash, it will not work. If you test it on the HTML page that you publish, it will work.
Your last method was correct. The on(press) one.
<B>EDIT:</B> Why are you loading the .swf files into the pop-up windows? You should load an .html file that contains the .swf. Is it because of the white margin around the movie? If so, I will tell you how to get rid of that.
Ok, getting rid of the margins in HTML are very easy. You will need to open up your .html file (an basic text edit works, even WordPad). Find the tag that says
<body>
and change it to say
<body topmargin="0" leftmargin="0">
If you want to go all out and wipe out everything about margins it goes like this…
I have now published (only the first link to test it) and when I click the close button I get an error page stating “The page cannot be found” instead of the main web
I remember learning Javascript. Even a missing “;” (or an extra one) can make or break your code. It drove me nuts, but I got the hang of it. I love Javascript now:)
do I use _blank, _top? in the code to close the window? I have tried this on the movie with the frame action to load all the movie on level one w/ all the buttons, I tried putting a button on the level 0 movies, I tried with it as an html and as an swf. I am totally doing something wrong. Right now it is in an html and the button to close is on level one(the one that loads the movie w/ all the buttons)