Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More on Non browser windows 1

Status
Not open for further replies.

bigbird3156

Programmer
Feb 20, 2001
183
AU
Hi there guys and thanks for your help, though this was not actually what I wanted....

You know how when you choose a .swf file from your computer it opens up in it's own window with the word flash on the title bar, the _ [] x buttons a a few others (file etc), but it opens to the actual size of the .swf movie. I was hoping to call up a .swf file from a html site that would open in this same flash window(or something like it).... is this possible???

hope you can help, thanks.

bigbird 3156
 
Why didn't you say so in the first place?
BTW... You should have posted in the first thread, so that everybody could see what the answers where!

Since you can't force a size, position etc... on the user's browser window, nor that you can force run an exec such as the standalone Flash player without his consent, I think you're still stuck with opening a new window to achieve your goal.

Opening a new window keeping the features that you want to keep. This example done at 1024x768 resolution (it will look different at lower resolutions such as 800x600), does just that. It can be positioned to be centered on any resolution, but just can't find the line of code I had to do that for now. This way the right-top buttons keep their functionability. The File etc. bar has got nothing to do with the player, so I didn't include it.The user would have to use the context menu.


B-) "If nothing else, I can always serve as a bad example!”
 
Thankyou oldnewbie for your help!!! :-D

That was what I wanted, however you mentioned about being able to position it, is this possible as when the window opens you can currently only see 1/2 of my movie X-), the other half is off screen.

If anyone can help, that would be great
 
This is the code for the main window that opens the Flash movie:

<html>
<head>
<title>OPEN & POSITION TEST</title>
<script language=&quot;javascript&quot;>
var test=null
function flashopen()
{
if(test && !test.closed) {test.focus()}
else{
// Following 2 lines have no break! Should be one single line!
test = window.open(&quot;template.htm&quot;,&quot;test&quot;,&quot;directories=0,menubar=no,toolbar=no,location=no,status=0,scroll=0,resizable=no&quot;)
// Following line set the original size of the flash movie...
test.resizeTo(600,400)
test.moveTo(200,300)
test.focus()
}
}
</script>
</head>

<body bgcolor=&quot;#000000&quot; scroll=no>

<P><center>
<br><br><br><br>
<input type=&quot;button&quot; value=&quot;OPEN FLASH MOVIE&quot; onclick=&quot;flashopen();&quot;>
</center></P>
</center>
</html>

Play with the bold section. That repositions the new opened window. It is in pixels, in relation to the top left corner and obviously resolution dependent. You can use negative values!

B-)
&quot;Who's that guy with the shades... What's he trying to prove!”

 
Thanks again...

I assumed that that was the case and played around with it a bit, however, in the site where I have put it it does not seem to work, and it even sometimes causes an error, I guess I'll have to keep trying to get it working, if you want to see what I mean go to and go to the sydney 2000 link in the header.

If you think you can help I'd apreciate it!!
 
Had a look at it! For now, it's seems to be repositioning the window to where you're sending it, i.e. 1,1, without errors. Still looking for that centered positioning code (according to screen resolution) for you, but it will use the same .moveTo setting. Meanwhile, I don't know if you've noticed but when opening, your movie hangs on the preloader, I have to open it with the context menu... You might want to check that!

Will get back to you on this soon,

B-) &quot;Who's that guy with the shades... What's he trying to prove!”

 
yeah, thanks, I worked out what my initial problem was and fixed it up probably before you got to check it, I was calling the .swf file from the header rather than a html page that controls the .swf, but thanks anyway.

I thought I had fixed up that hang in the loading section, but obviously not - obviously if the whole movie loads before the end of the first loop it does not hang, but on the second loop it does hang....dang!!! I may need to get back to you on this one if I cant fix it

Again thanks!!
 
OK! Here's the code I promised!
Actually it's from swilliams from the javascript forum.

<html>
<head>
<script language=&quot;Javascript&quot;>
// set the size of your new window
var window_width = 400;
var window_height = 400;


function open_window(){
var left = (screen.width-window_width)/2;
var top = (screen.height-window_height)/2;
msg=window.open(&quot;newpage.html&quot;,&quot;msg&quot;,&quot;height=&quot;+window_height+&quot;,width=&quot;+window_width+&quot;,left=&quot;+left+&quot;,top=&quot;+top);
}

</script>
</head>
<body onload=&quot;open_window();&quot;>
Hello there!!!
<body>
</html>

Don't forget to change the bold with your swf sizes.
This seems to work fine with IE & NS and should be user's resolution independant!
It works for me at 1024*768... Won't try it at lower resolution 'cause it screws up my desktop! We don't all have two monitors! ;-)

B-) &quot;Who's that guy with the shades... What's he trying to prove!”

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top