Marius
07-10-2003, 04:45 AM
Hi,
I'd like to create a javascript that creates and adds an flash object to the site with appropriate size properties.
Everything works so far, but the flash movie isn't presented.
After decompiling the script I found out that from all the outerHTML code ...
"<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=6,0,0,0 height=181 width=250>
<PARAM NAME=\"_cx\" VALUE=\"5080\">
<PARAM NAME=\"_cy\" VALUE=\"5080\">
<PARAM NAME=\"FlashVars\" VALUE=\"5080\">
<PARAM NAME=\"Movie\" VALUE=\"test.swf\">
<PARAM NAME=\"Src\" VALUE=\"test.swf\">
<PARAM NAME=\"WMode\" VALUE=\"Window\">
<PARAM NAME=\"Play\" VALUE=\"-1\">
<PARAM NAME=\"Loop\" VALUE=\"-1\">
<PARAM NAME=\"Quality\" VALUE=\"High\">
<PARAM NAME=\"SAlign\" VALUE=\"\">
<PARAM NAME=\"Menu\" VALUE=\"-1\">
<PARAM NAME=\"Base\" VALUE=\"\">
<PARAM NAME=\"AllowScriptAccess\" VALUE=\"always\">
<PARAM NAME=\"Scale\" VALUE=\"ShowAll\">
<PARAM NAME=\"DeviceFont\" VALUE=\"0\">
<PARAM NAME=\"EmbedMovie\" VALUE=\"-1\">
<PARAM NAME=\"BGColor\" VALUE=\"\">
<PARAM NAME=\"SWRemote\" VALUE=\"\">"
one caracter is disturbing flash. Its this line:
<PARAM NAME=\"Movie\" VALUE=\"test.swf\"> :mad:
the backslash in the file parameter is the problem.
<PARAM NAME=\"Movie\" VALUE="test.swf">
would work.
So i decided to replace all (/") parts with a ('), but all the replace functions didn't work correctly. Mainly because I don't understand the definition of a regular expression. :rolleyes:
The whole code is looking like this:
/* Die Replace Funktionen zum Testen */
function replaceStr(text,expression,value)
{
var exp = new RegExp(expression,'g');
return text.replace(exp,value);
}
function checksize()
{
if (Fensterweite() <= 500) {
var Flashobj = document.createElement("object");
Flashobj.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
Flashobj.codeBase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";
Flashobj.height = "181";
Flashobj.width = "250";
Flashobj.Movie = "test.swf";
Flashobj.Quality2 = "High";
Flashobj.EmbedMovie = "True";
/* Funktion um die automatisch Eingefügten '/"' Zeichen zu ersetzen:*/
fehler;
var htmlcode = Flashobj.outerHTML;
// htmlcode.replace(/\/g,"");
htmlcode = replaceStr(htmlcode,"\\","");
//Flashobj.outerHTML = htmlcode;
var Plazierung = document.getElementById("Flashlayer");
Plazierung.appendChild(Flashobj);
//window.history.go(0);
//location.reload();
//fehler;
}
}
Anyone an idea of how to correct this parameter or another way of dynamically inserting an flash objekt in a html page?
Any idea or help is appreaciated :)
Greetz
Marius
P.s. Sorry for my bad english and any mistake is just for your pleasure. ;)
I'd like to create a javascript that creates and adds an flash object to the site with appropriate size properties.
Everything works so far, but the flash movie isn't presented.
After decompiling the script I found out that from all the outerHTML code ...
"<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#
version=6,0,0,0 height=181 width=250>
<PARAM NAME=\"_cx\" VALUE=\"5080\">
<PARAM NAME=\"_cy\" VALUE=\"5080\">
<PARAM NAME=\"FlashVars\" VALUE=\"5080\">
<PARAM NAME=\"Movie\" VALUE=\"test.swf\">
<PARAM NAME=\"Src\" VALUE=\"test.swf\">
<PARAM NAME=\"WMode\" VALUE=\"Window\">
<PARAM NAME=\"Play\" VALUE=\"-1\">
<PARAM NAME=\"Loop\" VALUE=\"-1\">
<PARAM NAME=\"Quality\" VALUE=\"High\">
<PARAM NAME=\"SAlign\" VALUE=\"\">
<PARAM NAME=\"Menu\" VALUE=\"-1\">
<PARAM NAME=\"Base\" VALUE=\"\">
<PARAM NAME=\"AllowScriptAccess\" VALUE=\"always\">
<PARAM NAME=\"Scale\" VALUE=\"ShowAll\">
<PARAM NAME=\"DeviceFont\" VALUE=\"0\">
<PARAM NAME=\"EmbedMovie\" VALUE=\"-1\">
<PARAM NAME=\"BGColor\" VALUE=\"\">
<PARAM NAME=\"SWRemote\" VALUE=\"\">"
one caracter is disturbing flash. Its this line:
<PARAM NAME=\"Movie\" VALUE=\"test.swf\"> :mad:
the backslash in the file parameter is the problem.
<PARAM NAME=\"Movie\" VALUE="test.swf">
would work.
So i decided to replace all (/") parts with a ('), but all the replace functions didn't work correctly. Mainly because I don't understand the definition of a regular expression. :rolleyes:
The whole code is looking like this:
/* Die Replace Funktionen zum Testen */
function replaceStr(text,expression,value)
{
var exp = new RegExp(expression,'g');
return text.replace(exp,value);
}
function checksize()
{
if (Fensterweite() <= 500) {
var Flashobj = document.createElement("object");
Flashobj.classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
Flashobj.codeBase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";
Flashobj.height = "181";
Flashobj.width = "250";
Flashobj.Movie = "test.swf";
Flashobj.Quality2 = "High";
Flashobj.EmbedMovie = "True";
/* Funktion um die automatisch Eingefügten '/"' Zeichen zu ersetzen:*/
fehler;
var htmlcode = Flashobj.outerHTML;
// htmlcode.replace(/\/g,"");
htmlcode = replaceStr(htmlcode,"\\","");
//Flashobj.outerHTML = htmlcode;
var Plazierung = document.getElementById("Flashlayer");
Plazierung.appendChild(Flashobj);
//window.history.go(0);
//location.reload();
//fehler;
}
}
Anyone an idea of how to correct this parameter or another way of dynamically inserting an flash objekt in a html page?
Any idea or help is appreaciated :)
Greetz
Marius
P.s. Sorry for my bad english and any mistake is just for your pleasure. ;)