This is a discussion on "Java Scripting for pop-ups???" within the JavaScript Forum section. This forum, and the thread "Java Scripting for pop-ups??? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Java Scripting for pop-ups???
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Java Scripting for pop-ups???
Hi, i have a question about coding an HTML with multiple pop-ups. Here is what I have so far:
<script language="JavaScript"> function pop(){ window.open("termsofuse.html","","height=792,width =612,left=0,top=0"); } </script> yes, this script is between both </HEAD>'s. Now, lets say I have 100 pop-ups, do I simply repeat the entire above script, change the "termsofuse.html" to whatever or is there another way? For example, like this?: <script language="JavaScript"> function pop(){ window.open("termsofuse.html","","height=792,width =612,left=0,top=0"); } </script><script language="JavaScript"> function pop(){ window.open("paymentpolicy.html","","height=792,wi dth=612,left=0,top=0"); } </script> <script language="JavaScript"> function pop(){ window.open("nondisclosure.html","","height=792,wi dth=612,left=0,top=0"); } </script> Or is there another way? I know this is a total noob question, but hey...at lleast i'm actually using code... |
|
|
|
|||
|
Pop-ups
1. You can't have more than one function with exactly the same name.
2. You could have 100 functions with slightly different names, eg pop1(), pop2(), pop3(), etc but that is a tedious construct. 3. You could try one function with the filename passed as a string parameter function pop(fname) { window.open(fname,"","width= etc, etc, } and use this function with calls like pop("termsof use.html") or pop("paymentpolicy.html") |
|
|||
|
hmmm, like this?
<script language="JavaScript"> function pop(){ window.open("termsofuse.html", "nondisclosure.html", "etc.htm", "etc.html", "height=792,width=612,left=0,top=0"); } </script> What would be an example script? |
|
|||
|
Um, before getting to the how I'm curious about the why...
So, why so many popups? I'm guessing you don't need to do what you're trying to do in this way. |
|
|||
|
Like I said above you need one javascript function in the head of your html file like
<script language=javascript type="text/javascript" > <!-- function pop(fname) { window.open(fname,"","width=792,height=612,left=0, top=0") ; } --> </script> and call this function with pop("termsof use.html"); or pop("paymentpolicy.html"); where necessary in the body of your HTML file. |
|
|||
|
Cat, I decided to have other windows open in regards to viewing larger versions of art, documents, information, etc, as opposed to having everything enclosed in 1 Flash movie (waaaaay too large). If I put everything in 1 movie, it might be a 5 meg website, lol. Waaaay too big even with a pre loader.
|
|
|||
|
You should talk to sirkent about this. You can load parts of your site into your main Flash movie as needed.
loadMovie for example Popups can be a problem in several ways, and you should avoid them whenever possible. |
|
|||
|
really? Wow, i did not know that. Well, I have no idea at this point how to do that (i barely know how to do the whole pop-up thing). Yes, originally I wanted to have something that loads a seperate file 'seperately' ('like' a pop-up) but not really a pop-up, ya know? It ouwl load in the movie as needed. I just have no clue how to code it in my html or what actionscript I have to use in my Flash movie, what to put for the buttons that link to what, etc., etc., CSS, PHP, ASP, BSB, JAVA, ???? If someone has a sample .fla or some scripts i can look at to study, that would be awesome too. Or maybe a site that I can look at the source or something. For now, I think the pop-ups would be easier to do (until i release v3.1 (an update, lol). Thanks.
|
|
|||
|
Here's one tutorial: http://www.cbtcafe.com/flash/loadmovie/loadmovie.html
but there's plenty of others, and if you make a post in the Flash forum I'm sure you'll get all the help you need in using loadMovie. On the scale of doing things in Flash it's not too bad. |
![]() |
| Tags |
| java, scripting, popups |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| life scripting | alexgeek | Webforumz Cafe | 17 | Aug 26th, 2007 16:26 |
| Flash scripting | acrikey | Flash & Multimedia Forum | 7 | Aug 11th, 2007 01:14 |
| Java/GUI/Server Developer (Java, EJB/Hibernate, SWING) - Berkshire | Web JobBot | Job Opportunities | 0 | Jan 16th, 2007 09:30 |
| scripting help | berjoe | Flash & Multimedia Forum | 5 | Oct 3rd, 2006 16:55 |
| PHP scripting help please | D3mon | PHP Forum | 9 | Jun 14th, 2004 20:06 |