# Java send variable problem

**URL:** <https://forum.kirupa.com/t/java-send-variable-problem/172085>\
**Category:** Uncategorized\
**Created:** [December 11, 2005, 3:01am UTC](https://forum.kirupa.com/t/java-send-variable-problem/172085 "2005-12-11T03:01:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edurs2000](https://avatars.discourse-cdn.com/v4/letter/e/f4b2a3/32.png) [@Edurs2000](https://forum.kirupa.com/u/Edurs2000)\
**Post date:** [December 11, 2005, 3:01am UTC](https://forum.kirupa.com/t/java-send-variable-problem/172085/1 "2005-12-11T03:01:51Z")

</div>

HI,

I´m trying to make a page with many vídeos links… and each vídeo link has just a path for a variable in java…with the right name of the flv file.  
This is for make only one swf with a video player that changes the videos with the links in java, but don´t work… something is rong…

any help?

**in flash I used.:**

import mx.video.\*;  
telavideo.contentPath = caminho;  
var listenerObject:Object = new Object();  
listenerObject.metadataReceived = function(eventObject:Object):Void {  
telavideo.setSize(telavideo.preferredWidth, telavideo.preferredHeight);  
}  
telavideo.addEventListener(“metadataReceived”, listenerObject);

**in html:**

\<HTML\>  
\<HEAD\>  
\<TITLE\>mjavascript to flash\</TITLE\>

\<SCRIPT LANGUAGE=“JavaScript”\>  
\<!–  
var movieName = “testcommand”;  
function thisMovie(movieName) {  
// IE and Netscape refer to the movie object differently.  
// This function returns the appropriate syntax depending on the browser.  
if (navigator.appName.indexOf (“Microsoft”) !=-1) {  
return window[movieName]  
} else {  
return document[movieName]  
}  
}  
// Checks if movie is completely loaded.  
// Returns true if yes, false if no.  
function movieIsLoaded (theMovie) {  
if (typeof(theMovie) != “undefined”) {  
return theMovie.PercentLoaded() == 100;  
} else {  
return false;  
}  
}  
function videoa() {  
if (movieIsLoaded(thisMovie(movieName))) {  
//thisMovie(movieName).GotoFrame(theFrame);  
caminho = “video2.flv”;  
SetVariable(“video2.flv”, caminho);  
}  
}

}  
function videob() {  
if (movieIsLoaded(thisMovie(movieName))) {  
thisMovie(movieName).caminho = “video1.flv”;  
}  
}

//–\>  
\</SCRIPT\>  
\<meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1”\>\<style type=“text/css”\>  
\<!–  
body {  
background-color: #666666;  
}  
–\>  
\</style\>\</HEAD\>  
\<BODY\>  
\<DIV ALIGN=“CENTER”\>  
\<object classid=“clsid:D27CDB6E-AE6D-11cf-96B8-444553540000” codebase=“[http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0](http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0)” name=“testcommand” width=“370” height=“300” id=“testcommand”\>  
\<param name=“movie” value=“videosflv.swf”\>  
\<param name=“quality” value=“high”\>\<param name=“LOOP” value=“false”\>  
\<embed src=“videosflv.swf” width=“370” height=“300” loop=“false” quality=“high” pluginspage=“[http://www.macromedia.com/go/getflashplayer](http://www.macromedia.com/go/getflashplayer)” type=“application/x-shockwave-flash” name=“testcommand”\>\</embed\>  
\</object\>  
\<FORM\>  
\<INPUT TYPE=“BUTTON” VALUE=“Video2” ONCLICK=“videoa()”\>  
\<INPUT TYPE=“BUTTON” VALUE=“video1” ONCLICK=“videob()”\>  
\</FORM\>  
\</CENTER\>  
\</BODY\>  
\</HTML\>
