Hi all,
I am trying to create a JS file through which I make necessary things run without defining them every time from scratch.
But I am getting error like ‘[COLOR=Red]Object doesn’t support this property or method[/COLOR]’ and don’t know what’s the problem and one more thing is
The flash object connects to a webservice and receives the result from the service.
Could I write all necessary functions to embed flash object and write response to the Document which comes from flash ??
my JS file code :
//creates script tag which includes swfobject.js file to create flash object...
function include(file)
{
var script = document.createElement('script');
script.src = file;
script.type = 'text/javascript';
script.defer = true;
document.getElementsByTagName('head').item(0).appendChild(script);
}
// Div tag which holds flash content...
function createDiv()
{
var dv = document.createElement("div");
dv.id = "flashcontent";
document.body.appendChild(dv);
}
// script element to create flash object...
function runScript(){
var script = document.createElement('script');
script.type = 'text/javascript';
script.defer = true;
script.innerHTML = "var sl = new SWFObject('webservice.swf', 'single', '300', '300', '8');
sl.write('flashcontent');"
document.getElementsByTagName("body").appendChild(script);
}
// writes responce from flash to the Document...
function writeResponce(s){
document.write(s);
}
include("swfobject.js");
createDiv();
runScript();
Thanks in advance…
pandu