...

View Full Version : ScriptConfusion



bibi
06-20-2002, 08:31 AM
HI
Iīm new with JavaScript and I have a question. I surfed dozins of forums 2 find the answer but I got all confused with so many (mostly just slightely different) codes & scripts.
Here is what I want 2 know:
I made a flash intro, and then a button appears, and when u click it, I want a popup window 2 open (not fullscreen, not centered).
Now I collected many codes but I really canīt seem 2 find out WHICH part I should paste WHERE...
Could u please make an example (as for a child) 2 help me out?!
Iīd appriciate it a lot!Thanxx!!:rolleyes:

Zvona
06-20-2002, 08:35 AM
It'll always help us, if you post an URL or your source code here. That helps us to offer you a firm and proper answer faster, when we know the "environment".

So, post an URL or a part of your code.

A1ien51
06-20-2002, 06:39 PM
look at this

Pop Up Window Generator (http://www10.brinkster.com/A1ien51/scripts/PopUpWinGenV3.htm)

newmate
06-21-2002, 08:54 AM
Ok, let's see if I can break it down for you.
First, the script you create with the two parts 1="head" in red and 2="body"in green you will cut and paste ---->

<html>
<head>
<title>PopUpScript</title>
<script>
function PopUp(PopUpUrl){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=500;
placementy=300;
WinPop=window.open(PopUpUrl,"","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=1, left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
}
</script>
</head>
<body onload="PopUp('http://www.A1ien51.8k.com')">
</body>
</html>


Here it is used in a small page --->

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>This is it</title>
<script>
function PopUp(PopUpUrl){
var ScreenWidth=window.screen.width;
var ScreenHeight=window.screen.height;
var movefromedge=0;
placementx=500;
placementy=300;
WinPop=window.open(PopUpUrl,"","width=400,height=300,toolbar=0,location=0,directories=0,status=0,scrollbars=1,menubar=0,resizable=1, left="+placementx+",top="+placementy+",screenX="+placementx+",screenY="+placementy+",");
}
</script>


</head>

<body>

<table border="1" cellspacing="1" style="border-collapse: collapse" bordercolor="#111111" width="200" id="AutoNumber1" height="1000">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<p>&nbsp;<img border="0" src="pic5.jpg" width="207" height="342">&nbsp;&nbsp; </p>
<p><font size="7">This is it</font></p>
<body onload="PopUp('http://codingforums.com/showthread.php?s=&threadid=392')">
</body>

</html>
Note: 1, This <head> starts the head section and this </head> ends it. This <body> or <body background=somediscriptionofacolororgraphicfilesourcehere> starts the body section and this </body> ends it.
Note: 2, I replaced the url in the green onload body tag with the url for this page so in this example you will see a moveable, scrollable popup of this post. This is where you put the url to the page you want in the popup. Be sure to put your url inside the (' and the ')"> parts
Note: 3, You may need to make a blank type page to host your flash intro because this popup script is coded for url's and not a direct path to a folder or file.

bibi
06-21-2002, 10:23 AM
I wanna thank yall for your time & effort. Iīll try all the tips and codes and then get bakc to U:thumbsup: !!!!!!!!!!!

bibi
06-21-2002, 12:32 PM
Okay, I did some homework--Iīve visited popup generator, very handy!
But I still canīt make the button work in my flash intro...
Iīve also tried to work with your codes, Newmate, but unfortunately it didīnt get me what I needed...thanx anyway!
So hereīs the codes that I try 2 work with.
First I give u the code of the button and what it does, so u get an impression of what I want 2 happen:

<HTML>
<HEAD>
<TITLE>trial</TITLE>
<script language=javascript>
function openwindow()
{
window.open("http://www.mediaperspectief.nl", "openwindow", "width=300,height=300,left=50,top=50")
}
</script>
</HEAD>

<BODY bgcolor="#FFFFFF">
<form> <center><p>&nbsp;<input type=button value="consultancy" onclick="openwindow()" NAME="consultancybutton"></p></center></form><!-- URL's used in the movie-->
<!-- text used in the movie-->
</BODY>
</HTML>

And hereīs the code for the flashmovie in which the button has to trigger the popup window, which is definitly not happening...

<HTML>
<HEAD>
<script language=JavaScript>
function openNewWindow(URLtoOPen, windowName, windowFeatures)
{
newWindow=window.open(URLtoOpen, windowName, windowFeatures);
}
</script>
<TITLE>trialmovie</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<A HREF=javascript:openNewWindow ('www.mediaperspectief.nl','thewin','height=300,width=400,top=50,left=50')"); }></A> <!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=550 HEIGHT=400> swLiveConnect=true NAME=button.swf
<PARAM NAME=movie VALUE="trialmovie.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="trialmovie.swf" quality=high bgcolor=#FFFFFF WIDTH=550 HEIGHT=400 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</OBJECT>
</BODY>
</HTML>


Okay, beatiful if anyone could unsolve this mistery 4 me!!

:p
Petr@



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum