You can definitely create dom objects on the fly and then use embedSWF to
replace it with a SWF. Or you can dynamically create a DOM object, and put
another child object inside it, and then replace that child object with your
swf.
The syntax for creating a dom object varies depending on if you're using a
framework or not. Like in jquery, you can do:
$("<div></div>").attr("id","mydiv").... and go from there.
The underlying javascript is usually just "document.createElement(...)".
In any case, when you create an element, make sure it gets a unique id, and
then use that id to pass into your embedSWF() call, and you should be fine.
--Kyle
--------------------------------------------------
From: "Bertrand" <[email protected]>
Sent: Monday, April 20, 2009 12:12 PM
To: "SWFObject" <[email protected]>
Subject: Referencing an element in call to embedSWF
>
> Hi,
>
> I'm working with iFrames and Flash content and I have a question (2 in
> 1 really):
>
> Is there a way to embed Flash content into a dynamically created div
> (created with createElement) before it's inserted into the DOM?
>
> Or is there a way to reference the parent document from a javascript
> that resides in an iFrame. My problem here is that when referencing
> the name of the target div upon calling embedSWF, it just doesn't work
> because that DIV is in the parent document.
>
> I would like to be able to do something like swfobject.embedSWF
> ("foobar.swf", window.parent.document.getElementById
> ('foobang'), .....) or something to that effect.
>
> Any suggestion more than welcome :)
>
> Cheers,
>
> Bertrand.
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SWFObject" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/swfobject?hl=en
-~----------~----~----~----~------~----~------~--~---