Hi all,
I'm trying to break apart a long line of javascript code. I'm putting it in a LANSA application, and the proprietary editor really hates long lines.
I have a random generator that displays one of several .swf files. As it sits, the function for each movie is in the loooong line. All of the code that retrieves the .swf, from <object> to </object> is what is making it so long.
I've tried to break it up into several shorter lines using the following method (it errors out, telling me I'm missing a ';') :
function movie2(){
var thismovie = '';
thismovie += "first section of Flash object...";
thismovie += "second section....";
thismovie += "and so on.";
document.write(thismovie);
Here's the actual example, just harder to follow in the text window:
if (randomnumber == 1){ movie1();}else if (randomnumber == 2){movie2();}
else if (randomnumber == 3){movie3();}else if (randomnumber == 4){movie4();}else {movie5();}
//Functions to write out the correct flash movie resource.
function movie1(){
var thismovie = '';
thismovie += "<OBJECT classid=\"clsid 27CDB6E-AE6D-11cf-96B8-444553540000\"";
thismovie += "codebase=\"https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\"";
thismovie += "WIDTH=\"240\" HEIGHT=\"177\" id=\"hawaii16\" ALIGN=\"\"><PARAM NAME=movie VALUE=\"flash/hawaii/hawaii16.swf\"> ";
thismovie += "<PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=wmode VALUE=transparent>";
thismovie += "<PARAM NAME=bgcolor VALUE=#e7e2dc> <EMBED src=\"flash/hawaii/hawaii16.swf\" loop=false quality=high";
thismovie += "wmode=transparent bgcolor=#e7e2dc WIDTH=\"240\" HEIGHT=\"177\" NAME=\"hawaii16.swf\"";
thismovie += "ALIGN=\"\" TYPE=\"application/x-shockwave-flash\"";
thismovie += "PLUGINSPAGE=\"https://www.macromedia.com/go/getflashplayer\"></EMBED></OBJECT>")}";
document.write(thismovie);
I'm having trouble figuring out why it's not working.... any help would be much appreciated!!!
EK.