GIDForums  

Go Back   GIDForums > Computer Programming Forums > Java Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Feb-2006, 12:23
Kacyndra's Avatar
Kacyndra Kacyndra is offline
Member
 
Join Date: May 2005
Location: Maryland
Posts: 230
Kacyndra will become famous soon enough

Passing parameters


this works
JAVA Code:
<a href="#" onclick="OpenWindow()">000</a>

function OpenWindow()
     {

         OpenWindow=window.open("","newwin","height=400,width=685,toolbar=no,scrollbars="+scroll+",menubar=no");
         OpenWindow.document.write("<TITLE>My Embedded Video</TITLE>");
         OpenWindow.document.write("<BODY BGCOLOR=000000>");
         OpenWindow.document.write("<embed name='RAOCXplayer' src='http://xrumxrum.com/video/Bloop.wmv' type='application/x-mplayer2' width='400' height='302' ShowC.'1' ShowStatusBar='1' AutoSize='true'EnableC.'0' DisplaySize='0'  pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed> ")
         OpenWindow.document.write("</HTML>")
        OpenWindow.document.close()
     }



this doesn't work.......... whY????
please help

JAVA Code:

<script language="javascript">
function OpenWindow(url)
     {
     alert(url);
         OpenWindow=window.open("", "newwin","height=400,width=685,toolbar=no,scrollbars="+scroll+",menubar=no");
         OpenWindow.document.write("<TITLE>My Embedded Video</TITLE>");
         OpenWindow.document.write("<BODY BGCOLOR=000000>");
         OpenWindow.document.write("<embed name='RAOCXplayer' src='+url+' type='application/x-mplayer2' width='400' height='302'	ShowC.'1' ShowStatusBar='1' AutoSize='true'EnableC.'0' DisplaySize='0'  pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed> ")
         OpenWindow.document.write("</HTML>")
	 	 OpenWindow.document.close()
     }



</script>
<body>


<a href="#" onclick="OpenWindow('http://xrumxrum.com/video/Bloop.wmv')">000</a>
__________________
Xrum!
  #2  
Old 28-Feb-2006, 14:34
TreyAU21's Avatar
TreyAU21 TreyAU21 is offline
Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 116
TreyAU21 has a spectacular aura aboutTreyAU21 has a spectacular aura about

Re: Passing parameters


That's actually Javascript as you probably know... and someone in the Miscellaneous languages forum might could help you better (as Javascript is quite different from Java). However, if you go into a little more depth as to what it's doing and what you are expecting it to do... maybe I can help. I have a little (and I emphasize "little") experience with Javascript.

It looks like you are calling everything properly? When you call the function, does an alert box come up printing the URL that is being passed? That should at least work. And why is that in there by the way... were you just using it for testing purposes?
__________________
If practice makes perfect and nobody's perfect... why practice?

Homepage: http://www.treywhite.com
Blog: http://www.treywhite.com/blog.php
Web Design Company: http://www.ewebproductions.com
  #3  
Old 01-Mar-2006, 07:10
Kacyndra's Avatar
Kacyndra Kacyndra is offline
Member
 
Join Date: May 2005
Location: Maryland
Posts: 230
Kacyndra will become famous soon enough

Re: Passing parameters


hey
thanks for the reply.
yes the message box shows the right url, but when it gets to the function it doesn't work.

this is very frustrating
__________________
Xrum!
  #4  
Old 01-Mar-2006, 08:01
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,233
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: Passing parameters


This should get you started:
I did have to change a few things:
1. in the script tag, I changed 'language' to 'type'
2. in window.open, scrollbars should have yes or no
3. I used a docString variable to build a string to then use the write function once. This was necessary to get the passed-in url to the 'src' value of the embed tag. I could have use a string to simply build the embed tag, but it seemed a little easier to build it all at once [yes, some of those could have been combined to make it shorter]. Place another alert before the write, passing docString as the argument, to view the string. Also, notice the escape sequence \" before and after the url assignment to get those in place around the url string passed assigned to src.

Code:
<body> <script type="text/JavaScript"> function OpenWindow(url) { var docString="" alert(url); OpenWindow=window.open("", "newwin","height=400,width=685,toolbar=no,scrollbars=yes,menubar=no"); docString="<HTML>" docString=docString+"<HEAD>" docString=docString+"<TITLE>My Embedded Video</TITLE>" docString=docString+"</HEAD>" docString=docString+"<BODY BGCOLOR=000000>" docString=docString+"<embed src=\"" docString=docString+url docString=docString+"\" type='application/x-mplayer2' width='400' height='302' pluginspage=\"http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/\"></embed>" docString=docString+"</BODY>" docString=docString+"</HTML>" OpenWindow.document.write(docString) OpenWindow.document.close() } </script> <a href="#" onclick="OpenWindow('http://xrumxrum.com/video/Bloop.wmv')">000</a> </body>
Last edited by LuciWiz : 05-Mar-2006 at 07:17. Reason: Edited code tags (on Poster's request)
  #5  
Old 01-Mar-2006, 08:33
TreyAU21's Avatar
TreyAU21 TreyAU21 is offline
Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 116
TreyAU21 has a spectacular aura aboutTreyAU21 has a spectacular aura about

Re: Passing parameters


Hey Turbo... Javascript does have the += operator doesn't it
__________________
If practice makes perfect and nobody's perfect... why practice?

Homepage: http://www.treywhite.com
Blog: http://www.treywhite.com/blog.php
Web Design Company: http://www.ewebproductions.com
  #6  
Old 01-Mar-2006, 09:08
Kacyndra's Avatar
Kacyndra Kacyndra is offline
Member
 
Join Date: May 2005
Location: Maryland
Posts: 230
Kacyndra will become famous soon enough

Re: Passing parameters


hello,
it's me again
another problem....
if i click on a video - it works, but then if i try to play another one it breaks, and gives me an error

this is the errors:"The calle(server[not server applicaton]) is not available and disappeared; all connections are invalid. The call did not execute"


so for me to play the other video, i have to refresh the main site,and then it works.

why does it do that?

here is my code:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title></title> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> </head> <script language="javascript"> function OpenWindow(url) { alert(url); OpenWindow=window.open("", "newwin","height=400,width=685,toolbar=no,scrollbars="+scroll+",menubar=no"); OpenWindow.document.write("<TITLE>My Embedded Video</TITLE>"); OpenWindow.document.write("<BODY BGCOLOR=000000>"); OpenWindow.document.write("<embed name='RAOCXplayer' src='"+url+"' type='application/x-mplayer2' width='400' height='302' ShowC.'1' ShowStatusBar='1' AutoSize='true'EnableC.'0' DisplaySize='0' pluginspage='http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/'></embed> "); OpenWindow.document.write("</HTML>") OpenWindow.document.close() } </script> <body> <a href="#" onclick="OpenWindow('http://xrumxrum.com/video/MetroVideo.wmv')">000</a> <a href="#" onclick="OpenWindow('http://xrumxrum.com/video/FightUlik.wmv')">001</a> </body> </html>
__________________
Xrum!
  #7  
Old 01-Mar-2006, 10:13
TreyAU21's Avatar
TreyAU21 TreyAU21 is offline
Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 116
TreyAU21 has a spectacular aura aboutTreyAU21 has a spectacular aura about

Re: Passing parameters


Have you tried using the OBJECT HTML tag as opposed to the EMBED tag?
__________________
If practice makes perfect and nobody's perfect... why practice?

Homepage: http://www.treywhite.com
Blog: http://www.treywhite.com/blog.php
Web Design Company: http://www.ewebproductions.com
  #8  
Old 01-Mar-2006, 11:44
Kacyndra's Avatar
Kacyndra Kacyndra is offline
Member
 
Join Date: May 2005
Location: Maryland
Posts: 230
Kacyndra will become famous soon enough

Re: Passing parameters


hello,
it's me again
i keep finding new ways of doing this, and every time i do it, i get a new problem.

now - everything is peachy with the wmv files, but the mpg don't play.

does anyone know of a good (free) program tha would let me convert mpg to wmv?

or is that even possible?
__________________
Xrum!
  #9  
Old 01-Mar-2006, 12:02
TreyAU21's Avatar
TreyAU21 TreyAU21 is offline
Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 116
TreyAU21 has a spectacular aura aboutTreyAU21 has a spectacular aura about

Re: Passing parameters


I've never used this before... it was just first on a google search, but it looks like some good software. It has a 15-day free trail. See if it does what you want.

http://www.blazemp.com/convert_mpeg_to_wmv.htm
__________________
If practice makes perfect and nobody's perfect... why practice?

Homepage: http://www.treywhite.com
Blog: http://www.treywhite.com/blog.php
Web Design Company: http://www.ewebproductions.com
  #10  
Old 02-Mar-2006, 11:23
Error's Avatar
Error Error is offline
Junior Member
 
Join Date: May 2005
Posts: 42
Error is on a distinguished road

Re: Passing parameters


I think that Javascript has += and ++ operators.
 
 

Recent GIDBlogNot selected for officer school by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
passing parameter likeit C Programming Language 4 27-Jul-2005 07:33
Trouble passing STL into a function Clive73 C++ Forum 5 10-May-2005 18:00
parameter passing? jheron C++ Forum 15 02-Mar-2005 05:04
Passing referance and passing pointer Poolan C++ Forum 6 29-Oct-2004 07:18
passing parameters between forms eeschumann MySQL / PHP Forum 4 31-Oct-2003 00:12

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 21:42.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.