Creating an object in script 
Author Message
 Creating an object in script

Hi all!

    The following code works great in Netscape 6 PR2, but I need to get it
to work in IE 5.0 +. (I tried in IE 5.5) At the moment, it produces a
Runtime error: Unexepected call to method or property access at the
appendChild methods on the elements I created in
JavaScript:(objectnode.appendChild(childnodeparam1); and
objectnode.appendChild(childnodeparam2);). I tried in jscript and VBScript.
I need a solution fast. Can anyone please help me, please?

<HTML>
<HEAD>
<SCRIPT >

function playFlash()
{

  objectnode = document.createElement("object");

objectnode.setAttribute("classid","clsid:D27CDB6E-AE6D-11cf-96B8-44455354000
0");

objectnode.setAttribute("codebase"," http://www.*-*-*.com/ #version=4,0,0,0");
  objectnode.setAttribute("width", "400");
  objectnode.setAttribute("height", "100");
  objectnode.setAttribute("id", "myObject ");

  childnodeparam1 = document.createElement("param");
  childnodeparam1.setAttribute("name", "movie2");
  childnodeparam1.setAttribute("value", "index.swf");

  childnodeparam2 = document.createElement("param");
  childnodeparam2.setAttribute("name", "bgcolor");
  childnodeparam2.setAttribute("value", "#FFFFFF");

  objectnode.appendChild(childnodeparam1);
  objectnode.appendChild(childnodeparam2);

  embedobject=document.createElement("embed");
  embedobject.setAttribute("src","index.swf");
  embedobject.setAttribute("swLiveConnect","FALSE");
  embedobject.setAttribute("WIDTH","100%");
  embedobject.setAttribute("HEIGHT","100%");
  embedobject.setAttribute("QUALITY","high");
  embedobject.setAttribute("BGCOLOR","#FFCC00");
  embedobject.setAttribute("TYPE","application/x-shockwave-flash");

embedobject.setAttribute("PLUGINSPAGE"," http://www.*-*-*.com/
download/index.cgi?P1_Prod_Version=ShockwaveFlas");

  objectnode.appendChild(embedobject);

  document.getElementById('test').appendChild(objectnode);

Quote:
}

</SCRIPT>
</head>
<BODY onload="playFlash();">
<div id="test"
style="position:absolute;top:0px;left:0px;width:500px;height:500px">
</div>
</BODY>
</HTML>

Michelle Carrier



Sat, 08 Feb 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Can not create an object: "Scripting.FileSystemObject"

2. Creating an object (OCX) in a cgi script Help:)

3. Creating folders and the Scripting.FileSystemObject object

4. Creating folders and the Scripting.FileSystemObject object

5. Errors with VBScript macro - Can't Create Object, Script Engine Not Installed Correctly

6. Automation server can't create object and Scripting.FileSystemObject

7. Creating MAPI Objects with VB Script

8. Creating objects through scripting

9. Create Object Client Scripting Problem

10. Errors with VBScript macro - Can't Create Object, Script Engine Not Installed Correctly

11. Create Object Client Scripting Problem

12. Remote script creation times-out then throws error 0x800A01AD (ActiveX can't create object)

 

 
Powered by phpBB® Forum Software