|
|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Nov 2000
Location: London - UK
Posts: 191
|
![]() HELP !!! I'M SO STUCK...!!!!!!!!!! (I know all you pros out there will probably find this almost laughable - but for me.... it's a nightmare , trust me !!!) I'm currently working on a site that will have 4 pop up windows. The pop up itself is fine (link on the button to the html page "_blank", right?) - but I'd like it to be 600x400px and center itself on the visitor's screen (+ all 4 windows shoud open up in the same named window - if I ever get that far ). I think I know that the controlling of the window size and posiition needs to be Java script inside the html - where it goes, ie which page, which section (one bit in the HEAD and the other in the BODY, maybe?)... well, I'm so lost ![]() I've spend ages now trying to figure it out, went to find tutorials and scripts - just don't get it?!?!?! !?!?!? I'm not very good on the script side of things and Java is new territory to me.... so if anyone could give me a tip or pointer...!?!? That would be GREAT Thanks for listening Prisca |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Feb 2002
Posts: 4
|
I found this in flashkit, here you go:
Sometimes the swf file is not that much big to fit the browser's window and you know how ridiculous is a 300x450 swf file inside a maximized window with toolbar, status bar, address bar, all kinds of buttons and so many other unnecessary stuffs around it. You certainly have seen those cool popup windows that exactly fit what they have inside them. I am trying to tell you the secret behind these popups, step by step. Well, It is only a small JavaScript that does everything. Let's get started. Step 1. Create a button symbol in flash and attach this code to the instance on stage: on (release) { getURL ("JavaScript op();");} This code calls a JavaScript function -pop- that is inside the html file hosting it. That means when the button is released the JavaScript function pop will be executed. Step 2. Save your fla file and name it opener.fla. publish your file (Press F12) and open the HTML file that has just been created where you had saved the current fla file. Insert the JavaScript Code below, between the <Head> </Head> tags. IMPORTANT NOTE : DON'T COPY AND PASTE THIS CODE. REWRITE IT. <SCRIPT LANGUAGE="JavaScript"> function pop() { window.open("popup.html","","height=200,width=200, left=0,top=0"); } </script> Step 3. Now you have your button that will open a popup window named popup.html and it is the time for you to create another HTML file named popup.html that will be opened as I mentioned above. Ok this HTML file can also contain a swf file or whatever you put inside it But this HTML file will be opened with height and width you specify in the JavaScript code. That means you have to adjust what popup.html contains with your JavaScript code. Settings. You can adjust the popup's height (200 in the example) You can adjust the popup's width (200 in the example) You can specify the popup's position (x=0 & y=0 in the example) Troubleshooting. The opener.swf must be executed inside it's HTML file. I mean if you simply double click the opener.swf it opens your windows flash player not the Browser's window. The second thing is that you must specify the complete address of the page you want to open in the JavaScript code for example: window.open("http://www.2advanced.4t.com/popup.html", . . . . |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2002
Posts: 4
|
by the way, that smiley face is :
: (followed by) p |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Nov 2000
Location: London - UK
Posts: 191
|
Philippe,
thanks so much for your detailed answer!! ![]() It's geting late here, my brain's about to give up on me - so I'll try it out tomorrow with a fresh head! - I'll let you know ![]() Just wanted to say THANKS ![]() The site that I'm working on - that is giving me these headaches....., in case you're interested to take a look: http://www.contactmecard.com/ THANKS AGAN ![]() Happy fkashin' ![]() Prisca |
|
|
|
|
|
#5 |
|
Member
Join Date: Nov 2001
Posts: 33
|
OMG!!!!!!!!
OMG, to me that site was awsome... Im a noob with flash.. I wish i could have a buddy who can just help me out
, Im having the same kinda problem.. i cant get a popup window to open on flash, i did as u said above, i inserted the java script into the html file wich held the swf flash file. then for getURL i put the JavaScriptpop thing u said to put. When i click on the button it doesnt open any page and also it doesnt even open as a popup, it opens in the same browser, i tried making the target for the button _blank... it still doesnt open any page.. WHAT DO I DO Please dont laugh but im not to good with flash... this is what i have so far.. http://www.geocities.com/nextstagecs/site2.html Please HELP!! THANKS ALOT MY SCREEN NAME IS: o0CAD0o (for AIM) .. e-mail: cad00@bellsouth.net
|
|
|
|
|
|
#6 |
|
Member
Join Date: Nov 2001
Posts: 33
|
oh
Also if its not too much.. Eyedea, where can i go or how can i do it to set up a form for the site i dont know how to configure the CGI file and the sort of stuff.. THANK!!
|
|
|
|
|
|
#7 |
|
Member
Join Date: Mar 2001
Location: Lisbon, Portugal
Posts: 64
|
hi, dont know exactly what r u doin but for sure your script at the html page its wrongh <script language="JavaScript">var PUpage="76001072"; var PUprop="geocities"; replace with <script language="JavaScript"> var PUpage="76001072"; var PUprop="geocities"; </script> hope this helps trolljanz |
|
|
|
|
|
#8 |
|
Member
Join Date: Nov 2001
Posts: 33
|
I have the popup working now, all i need to know now is how to make that popup window scrollable.. oh by the way.. the popup is html, not flash. it wont let me scroll the html page...im stuck
THANX..
|
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Nov 2000
Location: London - UK
Posts: 191
|
Thanks everybody....
![]() Sorry I didn't respond sooner - only just got notified now - I haven't solved the problem yet - haven't had time to try, work was taking over... I'll get back to you as soon as I try out all the helpful tips you've given me... which should be in the next couple of days.... site to be launched officially 14/2/2002....Thanks again Till soon, Prisca |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Nov 2000
Location: London - UK
Posts: 191
|
still no result... ;(
hello again, guys....
just a quick update really, I said I'd let you know - still can't solve the problem completely... got a bit further though using this tutorial http://www.flashkit.com/tutorials/Ac...08/index.shtml It's the first one that worked straight away! Worth a look! I set up a quick experimental page, just to test it but can't get it to work 100%, as you can see : http://www.graphiceyedea.f2s.com/exp...erimental.html I am stuck on one thing now... all the buttons only open up one and the same pop up window, even though I've got the other 3set up. The thing I just can't get to work is the different links... it will only open up the one html, stated in the html bit, head tag. I've tried several different options, going into the AS in Flash, changing bits in the html (at one point on clicking any button all the pop up opened up at once, aaaarrgghhhh! )... I just can't figure it out... So close - yet still so far... Any more thoughts or tips on this would be great as Im almost there........ oOCADOo, you asked me where to go for the CGI stuff - I wouldn't know sorry... the contactmecard site was divided into 2 - I was doing the design and someone else was doing the database stuff, I'm not cut out for any of that - as you can tell with my difficulties solving the pop up problem! Sorry.... Happy flashin' everybody ![]() Prisca |
|
|
|
|
|
#11 |
|
Senior Member
Join Date: Mar 2001
Posts: 428
|
OK guys....this works for every purpose imaginable I believe. I wrote this sucker from a compilation of tons of variations of javascripts about popups and it is fully customizable from flash the flash button on how you want your window....size, menubar, address bar, status bar, etc. Everything. It is even centered! Now don't get all worked up about how complicated it looks...it is not. There may be an easier way, but this works everytime for every site I've done and that works for me...
Here we go.... THIS GOES INTO YOUR HTML DOCUMENT IN THE <HEAD> (DON'T TOUCH ANYTHING) IT WORKS AS IS... ----------------------------------------------- <script language="javascript" type="text/javascript"> <!-- var win=null; function NewWindow(mypage,myname,w,h,scroll,menubar,toolbar ,location,status,resizable,pos){ if(pos=="random"){LeftPosition=(screen.width)?Math .floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Mat h.random()*((screen.height-h)-75)):100;} if(pos=="center"){LeftPosition=(screen.width)?(scr een.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;} else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20} settings='width='+w+',height='+h+',top='+TopPositi on+',left='+LeftPosition+',scrollbars='+scroll+',m enubar='+menubar+',toolbar='+toolbar+',location='+ location+',status='+status+',resizable='+resizable +',directories=no'; win=window.open(mypage,myname,settings);} // --> </script> THIS GOES ONTO YOUR BUTTON IN FLASH ----------------------------------- on (release) { getURL ("javascript:NewWindow('http://www.timsantor.com','name','800','600','no','no','n o','no','no','no','center')"); } NOW IT LOOKS LIKE ALOT BUT HERE IS YOUR CUSTOMIZABILITY: These are in order from left to right: 1ST SETTING: The URL you want to open..a relative or absolute path (example:http://www.timsantor.com) 2ND SETTING: The NAME of the window to open...can anything you want it to be. 3RD SETTING: The WIDTH 4TH SETTING: The HEIGHT 5TH SETTING: SCROLLBARS (yes or no) 6TH SETTING: MENUBAR (yes or no) 7TH SETTING: TOOLBAR (yes or no) 8TH SETTING: LOCATION (yes or no) 9TH SETTING: STATUS (yes or no) 10TH SETTING: RESIZABLE (yes or no) 11TH SETTING: POSITION (center or random) THAT SHOULD DO IT FOR ALL YOUR NEEDS! HAVE FUN! |
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Oct 2000
Posts: 395
|
Hi all,
I have been using this javascript function for a while now but have noticed a problem.. i can open the pop-up windows and they will always replace each other i.e. if one is already open the new url will open in same pop-up window. - but my prob. is that if a pop-up is already open when I replace it - i.e. click on the pop-up link on my main window - the new pop-up will open behind the main window - is there a way within this javascript code to open always on top?? cheers beezer |
|
|
|
|
|
#13 |
|
Senior Member
Join Date: Nov 2000
Location: London - UK
Posts: 191
|
finger crossed....
Viper - it's been ages now that I tried to get something posted on here - just to say thanks really!!! So fingers crossed it won't pack in on me now.... and you will get this one....
THANK YOU THANK YOU THANK YOU THANK YOU ![]() You made my day! I tried so many different approaches and samples.... I couldn't beiev how easy your one worked - straight away...!!! THANKS!! ![]() Beezer, sorry, can't help you there... I just got my popup problem solved by a helpful spirit on here... Good luck! Happy flashin' everybody ![]() Prisca |
|
|
|
|
|
#14 |
|
Member
Join Date: Nov 2001
Posts: 33
|
FINALY!!, that script worked perfectly... thanks alot for the script Viper. Im a new-b with flash and was just working on this thing http://www.geocities.com/nextstagecs/main.html .If any of you are kind enough to send me maybe a fla. file or something of a full flash site that would be great. I still dont know how u people do it that good. Viper your site is Awsome.. How do you do it?
THANKS SO MUCH FOR EVERYTHING!!! e-mail: cad00@bellsouth.net AIM: o0CAD0o
|
|
|
|
![]() |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|