Opening links in presized windows?

I have all my links and swf files set up like this for the links:

on (release) {
getURL(“flash/MCTransitionsButtonsMove.swf”, _blank);

}

what I want is to have the swf files open in smaller sized windows with a button to close the window.

Could someone tell me how to do this?

thank you

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…

A HREF=“java script:close();”>Close Window</A

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.

Oh ok, I thought it would be HTML… in that case…


getURL("javascript:close()","_self")

Or something along those lines.

This isn’t PHP, but as you can see, the only way to keep HTML from converting is to use the PHP tags to show it.

I’ll try it now:)

Let me know if it works. And if there are any problems I am sure I will be able to help you out.

that did not work;
I tried it like this:

getURL(“java script:close()”,"_self")

and got this error:

“Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Statement must appear within on handler
getURL(“java script:close()”,”_self")"

Then like this and it says it can’t find the url:
on (press) {
getURL(“java script:close()”,"_self")
}

What am I doing wrong?

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.

It is because of that margin that i did not want to open in html. Please tell me how?

thank you

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…

<body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginwidth="0" marginheight="0">

I hope this helps you out:)

I will try this now

Let me know how that goes.

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

Would you mind checking it out to see what I mean?
page.http://www22.brinkster.com/laranelson/

Which link on your site do I click on to test it?

load multiple SWF’s then that will load the html file that contains the swf file. I published it and put it up in html as you suggested.

Ehew, I see what is wrong here. When you copied and pasted my code, for some reason the board put a space between java and script

it is one word…

javascript:close()

…like that

“it’s the little things that make us appreciate life” That is funny, I can’t believe I did not even think of that. I will fix it now. Thank you

Let me know how it goes after you fix it:)

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)

http://www22.brinkster.com/laranelson/

any Ideas??

I would think either _self or _top. If it doesn’t create an error, then don’t put anything there at all and try that.