;

PDA

Click to See Complete Forum and Search --> : Pop-Up Windows w/Javascript


fwhilton
02-10-2001, 10:53 PM
I am trying to create a html browser pop-up window with no menus, buttons, non-resizing etc... I want the scroll bars!

Seeing that javascript can be put in the "get url" in KoolMoves"....

What code would I use to open a browser (no menus-buttons etc..) kinda like the "openwindow()" javascript command???

Thanks!

fwhilton
02-11-2001, 12:26 AM
I have been working with this command...

javascript:window.open('test.htm','targfrme','widt h=325,height=330,left=50,top=50')

But I am getting erors... "line 1 & char 1" and "test is undefined"

A new browser appears, then a second which is the window I want, it has the correct sizes etc..

But my page is blank?

Any Ideas?

Thanks

Elizium
02-11-2001, 10:45 AM
Hi there,

It sounds like you are lacking the Javascript function which is required to do the pop-up?

If you add in your head tags of the host page the same code but as follows, all should be well:

function open_window(url)
{
open_window =window.open("fileto open","open_window","toolbar=0,location=0,directories=0,status=0,menuba r=0,scrollbars=0,resizable=0,width=300,height=200, top=100,left=50");
}

Altering the function name, sizes and options etc as needed. As far as I am aware this needs to be placed into the HTML document in which the SWF is embedded. I could be wrong there, but it's always worked for me.

Hope this is not a case of up-the-garden-path! Do let me know!

Jon

wdglide
02-11-2001, 01:35 PM
Or check this simple tutorial:

http://board.flashkit.com/board/showthread.php?threadid=81151

johnie
02-12-2001, 02:44 PM
You need to add void(0); to the end of it to work. I don't know why but you need something to realese the variables for it to work.


The command fromm Kool Moves would be javascript:window.open('url','windowname',attribut es);void(0);

With version 1.85 what you will do is select javascript from the actions and then add my piece of code to the dialog.

Chances are if you are getting an undifined error you followed the tut from flashkit but failed to place the Script before you embedded the SWF.

fwhilton
02-12-2001, 03:35 PM
HELP!

Hey Johnnie,

This is the code I am using in the 1.85 ver of KM

Javascript:window.open("test.htm","s","width=325,height=330,left=50,top=50");void(0);

I entered it in the "Advanced-Javascript" window.

I get my pop-up, but no content.
Then I get another browser window with the word "[object]" in the html page.

Why am I getting no content and 2 browsers (1 is the popup I want)?

And why does my pop-up window locked in memory. My hour glass cursor keeps spinning and I can't move the popup?

Thanks!

johnie
02-12-2001, 04:11 PM
Okay, Using Kool Moves 1.85 and IE 5.0 , I entered this into the dialog:

Javascript:window.open("http://www.google.com","s","width=325,height=330,left=50,top=50");void(0);

Then I tested it in the web browser.

The results was a square shaped window with Google loaded into it with no adress bar or navigation bar that was 325 px by 330 pix located on the left hand side of the screen. Since that was the case then the problem is not in the code itself.

I then looked at how you are using your URL- I cut the http:// off and low and behold I got a simular error. I would say that you need the full URL. The other problem that I pondered that it could be is that your document is not in the same directory as the SWF file. Another problem is that IE 5.5 in the first realease did not like Javascript with SWF's. Yet another problem could be that IE for mac and netscape may not lock down the embedded window.

Try using the full url (dont leave of the http:// or the www) and see if it works. Then check the version of your browser. If it is IE 5.5 then you will have to use FS Commands- which will not work for any MAC vfersion of IE, the Linux version of IE, Netscape 6, or Any version of IE or Netscape bellow IE 3.0 and NS 3.0. See this is what I mean by people not knowing what they are talking about. Most people will tell you to use FS commands to send Javascript instead of the javascript command but they do not realize that FS Commands cannot be used by more browsers than using the javascript command and in fact by making it work for IE 5.5 you exclude more people than you include.

fwhilton
02-12-2001, 05:14 PM
Thanks Johnnie for your help..

I entered this...

Javascript:window.open("http://www.flashkit.com","s","scrollbars,width=325,height=330,left=50,top=50");void(0);

the popup worked fine with content, but I am still getting a second browser.

What now?

p.s. I do use IE 5.5

Thanks

johnie
02-12-2001, 08:04 PM
What is in the second browser?

It may be possible to close the extranous window using the window.document.close() method if what is in it is known or you may change focus to the newly opened window.

If the second window is blank then that is a -ummm- feature of IE 5.5.

fwhilton
02-13-2001, 09:32 AM
Johnnie,

The second browser is a full browser (menus, buttons etc..)

In the html page is the word "[object]"

Plus I tried the code somewhere else using IE 5.0 and it does the same thing as IE 5.5

This code is the same code that I use on my regular web pages, and the popup works fine.

Thanks

lafish
02-13-2001, 10:33 AM
-stick this on your button:

on (release) {
getURL ("JavaScript:openWindow(\"your-page-to-open.html/\",\"150\",\"150\")");
}

-nb:// the 150 by 150 is the size of the pop up window!!)
-and stick this in your web page (where your .swf is embed), between the <head> tags:

<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openWindow(url, w, h) {
var windowprops = "width=" + w + ",height=" + h;
popup = window.open(url,'remote',windowprops);
}
// done hiding -->
</script>

and tell me if it works (mail me: the notification is not working:) )

good luck

lafish
lafish@mailcity.com

lafish
02-13-2001, 10:37 AM
in the middle of my script a red face has slipped (a smily!!!) in fact you have to replace it with ":" ans "o".
mea culpa!!
lafish.

johnie
02-13-2001, 12:38 PM
I am not getting that response and I just updated to IE 5.5 What I am getting is a small pop-up with the URL loaded into it-

I made a screenshot of the action for you.



http://www.geocities.com/jsnider.geo/ss1.jpg





Lafish what you are suggesting works- IN FLASH 4 and 5!!!- but will unfortunatlty not work in Kool Moves as Flash 5 Actionscripting is slated for the Kool Moves Pro edition and is not available in Kool Moves version 1.85.

fwhilton
02-14-2001, 04:36 PM
Johnnie...

I used the exact code you have above...

now I get one browser, but no formatting...

I don't know why it works for you but not me..

I have tried it in IE 5 & 5.5
I also am using Win98 1st & Sec editions (2 seperate pc's)

I'll keep trying

Thanks for your help! :)

johnie
02-14-2001, 05:02 PM
I tested it on a Win 95 IE 5.5 (Latest version) and Win 98 version 2 with IE 5.0.

I could put the fun file up and allow you to download that?

Grab it fast as Geocities routinly grabs Zips off of their servers:

http://www.geocities.com/jsnider.geo/Popup.zip


If this does not work then their is something else wrong.

johnie
02-14-2001, 05:04 PM
PS. you will need to cut and paste that address in to your browser in order for the download to work!!!

Gota love Geocities ;)

fwhilton
02-15-2001, 08:11 AM
Johnnie...

I tried it on my machine...

and I am getting two browsers and no content..

I has to do with my machines and not KM or the code.

Thanks