Floating Window Codes

Actionscript or Java codes? and what code?

Page 1 of 1

5 Replies - 18677 Views - Last Post: 10 October 2006 - 11:09 AM

#1 marianneetienne  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-October 06

Floating Window Codes

Posted 05 October 2006 - 02:41 PM

Hello,
I am so glad I found you guys!
So here is my problem:
I built this Flash site(first one) for a photographer. Now I have thumbnails/button that open to a new browser window with the corresponding photo gallery. Now, my client wants the window to be menubarless, no scrollbar, basically only have the frame with her name on it. I see it all the time but I am having a real hard time finding the right way to do it... Right now, I have her galleries on regular browser window. First, should I add some Actionscript or Javascript to the button so the link would open onto the floating window. Do I have to add something to the galleries's HTML script? and where on it? Can you help me with the codes and all? If so, THANK YOU SO MUCH!! I have been pulling my hair out over this for the last few weeks. Let me know if you need more details,
Marianne

Is This A Good Question/Topic? 0
  • +

Replies To: Floating Window Codes

#2 capty99  Icon User is offline

  • i am colt mccoy
  • member icon

Reputation: 98
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Re: Floating Window Codes

Posted 05 October 2006 - 11:26 PM

its a javascript power your talking about.

here is the javascript that needs to go into the head of your page. notice, the toolbar=0, scrollbar=0 etc....
thats the part that says dont have any of these on there, if you wanted a toolbar you could set toolbar=1.
(0 meaning false, 1 meaning true)

you can go ahead and also change the width and height for the box in there, and the position at where it will pop up. (the left and top represent how far from each side the new window will appear)
<script LANGUAGE="Javascript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300,left = 550,top = 450');");
}
</script>



and here is the code for the link, obviously replace filename.html with the link you need to point to, and edit Open the Popup Window with your own text.
<A HREF="java script:popUp('filename.html')">Open the Popup Window</A>



lemme know if it works for ya.
Was This Post Helpful? 0
  • +
  • -

#3 marianneetienne  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-October 06

Re: Floating Window Codes

Posted 06 October 2006 - 06:58 AM

Good morning,
First, I want to thank you for taking the time to help me out. Second, I want to apologize for my lack of knowledge in this matter. This is my first Flash site, and I am completely out of my area of expertise...
Now, I know that if there is a piece of Java in my script then I have to have a piece of Java in my Flash file (on my buttons). I tried to add "java script:popUp('filename.html')" on my button on my .fla file (obviously I changed the 'filename' to the right file name). And I also added the other code you gave directly on my script... but it didn't open properly.
I am giving you what I have right now for my button in my .fla file:

on (release) {
	getURL("http://tracyshumate.com/gallery01_1/gallery01_1.html", "_blank");

}



perhaps you can tell where and how I should put the piece of Java.

Also, I am giving you my html script for my pop up window or floating window:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Tracy Shumate Gallery 01/1</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
#Layer1 {
	position:absolute;
	left:2px;
	top:0px;
	width:1752px;
	height:0px;
	z-index:1;
}
#Layer2 {
	position:absolute;
	left:16px;
	top:8px;
	width:348px;
	height:478px;
	z-index:2;
}
#Layer3 {
	position:absolute;
	left:444px;
	top:10px;
	width:344px;
	height:476px;
	z-index:3;
}
#Layer4 {
	position:absolute;
	left:866px;
	top:10px;
	width:344px;
	height:474px;
	z-index:4;
}
#Layer5 {
	position:absolute;
	left:1296px;
	top:8px;
	width:338px;
	height:476px;
	z-index:5;
}
#Layer6 {
	position:absolute;
	left:1654px;
	top:432px;
	width:50px;
	height:50px;
	z-index:6;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
	<td width="1752" height="8" colspan="11" valign="top"> </td>
  </tr>
  <tr>
	<td width="1752" height="424" valign="top"></td>
	<td height="478" colspan="7" rowspan="2" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1623" height="476">
	  <param name="movie" value="gallery01_1.swf" />
	  <param name="quality" value="high" />
	  <embed src="gallery01_1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1623" height="476"></embed>
	</object></td>
	<td width="20" height="424" valign="top"></td>
	<td width="50" height="424" valign="top"></td>
	<td width="50" height="424" valign="top"></td>
  </tr>
  <tr>
	<td width="1752" height="54" valign="top"></td>
	<td width="20" height="54" valign="top"></td>
	<td width="50" height="54" valign="bottom"><a href="java script:window.close()"><img src="../gallery03_1/close_button.jpg" alt="closeBtn" width="40" height="40" border="0" /></a></td>
	<td width="50" height="54" valign="top"></td>
  </tr>
  <tr>
	<td width="1752" height="1" valign="top"><img src="transparent.gif" alt="" width="14" height="1" /></td>
	<td width="348" height="1" valign="top"><img src="transparent.gif" alt="" width="348" height="1" /></td>
	<td width="80" height="1" valign="top"><img src="transparent.gif" alt="" width="80" height="1" /></td>
	<td width="344" height="1" valign="top"><img src="transparent.gif" alt="" width="344" height="1" /></td>
	<td width="78" height="1" valign="top"><img src="transparent.gif" alt="" width="78" height="1" /></td>
	<td width="344" height="1" valign="top"><img src="transparent.gif" alt="" width="344" height="1" /></td>
	<td width="86" height="1" valign="top"><img src="transparent.gif" alt="" width="86" height="1" /></td>
	<td width="338" height="1" valign="top"><img src="transparent.gif" alt="" width="338" height="1" /></td>
	<td width="20" height="1" valign="top"><img src="transparent.gif" alt="" width="20" height="1" /></td>
	<td width="50" height="1" valign="top"><img src="transparent.gif" alt="" width="50" height="1" /></td>
	<td width="50" height="1" valign="top"><img src="transparent.gif" alt="" width="50" height="1" /></td>
  </tr>
</table>
</body>
</html>



You can leave the window dimension as is, I will make the changes in time.
My teacher never really told where to add script. Can you help me add the code into that script?
Thank you SOOOOOO much,
Marianne

edit: added [code] tags ~ jayman9

Attached File(s)


This post has been edited by jayman9: 06 October 2006 - 08:06 AM

Was This Post Helpful? 0
  • +
  • -

#4 capty99  Icon User is offline

  • i am colt mccoy
  • member icon

Reputation: 98
  • View blog
  • Posts: 10,081
  • Joined: 26-April 01

Re: Floating Window Codes

Posted 06 October 2006 - 08:42 AM

okay,
im sorry i misunderstood your question when i read it the first time, or i didnt realize it had to be a flash button.

im not a flash master, might want to move this to the flash forum and get one of them in here.

but in the meantime, try adding the first bit of code i gave you to the html file on which the flash is placed, in the header.

then, in the actions on the button add
java script:popUp('filename.html')



with filename.html being the full url of the gallery,
im not sure if the javascript from the html page will carryover into the html,
thats a question for the flash gurus,
but its worth a shot.

sorry. hope they help you out .
Was This Post Helpful? 0
  • +
  • -

#5 Arbitrator  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 51
  • View blog
  • Posts: 530
  • Joined: 26-January 05

Re: Floating Window Codes

Posted 08 October 2006 - 03:58 AM

I would try using java script:popUp('filename.html') as the actual URI in your Flash and see if that gets passed directly to the browser; if it does, then that should work. You would need to target the current window instead of _blank though, otherwise you'll have two pop-up windows instead of one. Also note that there shouldn't be a space in the java script: URI scheme; that's a problem with the forum inserting a space when it encounters the word “Javascript” followed by a colon.

Accessibility: If you use window.open, I would recommend that you enable window resizing and/or window scrollbars (preferably both). I've encountered too many situations where you couldn't do either while the content was larger than the window (and thus unaccessable) because the author didn't consider that content looks different in different browsers.

Code: The syntax of the provided script is a bit dated as it uses a deprecated language attribute; that should be replaced with a type attribute. You also don't need the part of the script that gets the current date and time unless you want a new window for each call; if you use a static window name then all the links that utilize that name will re-use the same window, meaning fewer windows or tabs for users to manage.

I took another chance to practice Javascript coding. Here's a live example of window.open if you want to see it in action: http://jsg.byethost4...demos/DIC19351/. I modified the code a bit so that it would approximately center the pop-up window on the screen.
Was This Post Helpful? 0
  • +
  • -

#6 marianneetienne  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 05-October 06

Re: Floating Window Codes

Posted 10 October 2006 - 11:09 AM

I apologize for not responding faster, but it was Thanksgiving here in Canada and I am now back to work! I will try these
suggestions and I will let you know how it went. Thank you so much for all your help, I can't tell you how thankful I am.
Marianne
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1