Hopsel: Flashobjekt über JavaScript einfügen - FF vs. IE

Hi alle!

Mit

  var objFlash = document.createElement("object");  
  objFlash.setAttribute('type','application/x-shockwave-flash');  
  objFlash.setAttribute('width','800');  
  objFlash.setAttribute('height','600');  
  objFlash.setAttribute('data','test.swf');  
  var objParam = document.createElement("param");  
  objParam.setAttribute('name','src');  
  objParam.setAttribute('value','test.swf');  
  objFlash.appendChild(objParam);  
  document.body.appendChild(objFlash);

möchte ich eine Flashdatei einbinden.

Leider funktioniert das weder im Internet Explorer 7 noch im IE 6, d. h. es wird ein weißes Viereck der Größe 800x600 angezeigt.
Im IE 6 wird angezeigt, dass noch eine Element zu laden wäre. Auch der IE 7 zeigt an, dass er noch lädt.

Muss ich für den Internet Explorer das param-Attribut anders hinzufügen?
Wenn ja, wie?

Gebe ich den Code direkt als HTML-Code an, so wird die Flashdatei in IE7 und IE6 eingebunden:

  <object height="600" width="800" type="application/x-shockwave-flash" data="test.swf">  
  <param name="src" value="test.swf" />  
  </object>

Einziger Unterschied ist eine Abfrage, ob ich die Flashdatei wirklich ausführen lassen möchte.

Im Firefox 3.0 werden beide Varianten angezeigt.

Danke für´s Lesen,
MfG H☼psel

--
"It's amazing I won. I was running against peace, prosperity, and incumbency."
George W. Bush speaking to Swedish Prime Minister unaware a live television camera was still rolling, June 14, 2001
Selfcode: ie:% fl:( br:> va:) ls:& fo:) rl:? n4:& ss:| de:] js:| ch:? sh:( mo:) zu:)
  1. Hellihello

    http://blog.deconcept.com/swfobject/

    Dank und Gruß,

    frankx

    --
    tryin to multitain  - Globus = Planet != Welt
    1. Hi frankx!

      http://blog.deconcept.com/swfobject/

      Hat mir weitergeholfen.
      Ich füge das Objekt nun über innerHTML hinzu:
      document.body.innerHTML = '<object height="600" width="800" type="application/x-shockwave-flash" data="test.swf"><param name="src" value="test.swf" /></object>';

      MfG H☼psel

      --
      "It's amazing I won. I was running against peace, prosperity, and incumbency."
      George W. Bush speaking to Swedish Prime Minister unaware a live television camera was still rolling, June 14, 2001
      Selfcode: ie:% fl:( br:> va:) ls:& fo:) rl:? n4:& ss:| de:] js:| ch:? sh:( mo:) zu:)
      1. Hellihello

        Hat mir weitergeholfen.

        merci für die Rückmeldung.

        Dank und Gruß,

        frankx

        --
        tryin to multitain  - Globus = Planet != Welt
  2. Liebe Hopsel,

    objFlash.setAttribute('type','application/x-shockwave-flash');
      objFlash.setAttribute('width','800');
      objFlash.setAttribute('height','600');
    [...]
    Leider funktioniert das weder im Internet Explorer 7 noch im IE 6, d. h. es wird ein weißes Viereck der Größe 800x600 angezeigt.

    hatte denn nicht der IE Schwierigkeiten mit setAttribute?

    Ich mache das so...

    Liebe Grüße aus Ellwangen,

    Felix Riesterer.

    --
    ie:% br:> fl:| va:) ls:[ fo:) rl:° n4:? de:> ss:| ch:? js:) mo:} zu:)