...

View Full Version : Offline Popup window



tennisguy03
09-15-2005, 07:58 PM
First off I'm a n00b so please be patient with me. I've got a blog @ http://hazedthoughts.blogspot.com, and I'm having problems making java activate a offline popup. Also in conjuction to the blog there is something called a RadioBlog, if you haven't heard about it, please go here (http://radioblogclub.com), to see it. The RadioBlog is quite simply a player, that simply plays mp3's or rbs files from a designated directory on the server. Very simple right?

What I'm trying to do

You see, I want this blog to be viewed by two people, myself, and a very der friend of mine. The blog, will be in a sense, our safe-haven. With the thought of a personal blog in mind, when viewed I want a popup window of somesort to show up, and pop up the player. Under normal circumstances, this would be easy simply host the player and files on a server, and link to them. This is in fact the complete oppoisite of what I want to do. Reasons being, the playlist is far to large, and bandwidth usuage would be far to great. So in order to prevent this, I've decided to embed in a sub directory on both computers, both phyiscally in the same place, the same files, i.e.: C:\templates\radioblog\radioblog.swf.

The logic behind all this is simple, when she or I both veiw this page, a window will appear towards the bottom of the page, and launch a offline window, a window that is running locally and not remotely, it just needs something to tell it to open, when the time is right. Also, for those who do not have the sub directory on the computer they will not see or know its there at all, for its hidden into the page. I've tried to get this to work locally, and it worked fine, but rather when I load the excat same source onto Google's server, or any server for that matter, a white window will appear, and no player. I've searched and googled for countless hours, and found many answers. Some say its because Java doesn't have direct access to a computers file system, others say you can do it but you have a osfilewrite(), so with all this confusion I asked a college professor, and he said a window.location would work, but me the n00b I don't know what window.location is or its operators are at all.

So Googling window.locations I found this


<script language="javascript" type="text/javascript">
<!--
function gotoPage(custData) {
varnewUrl = "http://testsite.com/" + custData.custQualifier.value ;
alert (newUrl); // for testing purposes
var newWin = open("newWinUrl.html”, “newWinName”);
window.location=newUrl ;
return true ;
}
//-->
</script>

I don't have a clue as to what anyof that means and maybe you can help me in dechipering what it all means. So if I haven't confused you yet, here is my source for my code, and if you would like to test this out on your own, instead of downloading the radioblog, try linking directly to file thats on your computer and testing that way!

The Code


<script language="JavaScript1.2">
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var bouncelimit
var direction="up"
var usedropin=0
function PopupMe(){
if (!dom&&!ie&&!ns4){
window.open("file:///C:/streaming.iPod/radioblog.swf", "", "scrollbars=1")}else{
bouncelimit=32 //(must be divisible by 8)
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
crossframe=(dom)?document.getElementById("cframe") : ie? document.all.cframe : document.cframe
crossframe.src="file:///C:/streaming.iPod/radioblog.swf"
if(usedropin){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits}
crossobj.visibility=(dom||ie)? "visible" : "show"
if(usedropin){
dropstart=setInterval("dropin()",50)}}}
function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<0+scroll_top){
crossobj.top=parseInt(crossobj.top)+40+calunits
if (parseInt(crossobj.top)>0+scroll_top){crossobj.top=0+scroll_top}}else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)}}
function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)}}
function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
</script>

/*the following is the body onload code*/

<body onload="javascript:PopupMe()">
<div id="dropin" style="position:absolute;top:400; left:300; visibility:hidden;background-color:#F5F5F5;border:solid thin white">
<div align="right" style="background-color:white"><a href="#" onClick="dismissbox();return false"><FONT COLOR="#FFFFFF">[X]</FONT></a></div>
<IFRAME ID="cframe" SRC="" FRAMEBORDER=0></IFRAME></div>



Thanks for your Time!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum