Try this, as it should work:

var myDiv = document.createElement('div');
myDiv.id = 'something';
document.body.appendChild(myDiv);
swfobject.embedSWF('flash.swf', 'something', ....);

---------------------

As for the jQuery extension thing, here's a jQuery plugin for SWFObject, 
though I'm not so sure on how much of its internals are really SWFObject 
natives:

http://jquery.thewikies.com/swfobject/

(bonus, that plugin even has its own theme song! listen and enjoy!)



--Kyle





--------------------------------------------------
From: "Bertrand" <[email protected]>
Sent: Monday, April 20, 2009 12:31 PM
To: "SWFObject" <[email protected]>
Subject: Re: Referencing an element in call to embedSWF

>
>> 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.
>
> But my question was more about the way to embed the Flash content on
> that dynamically created object.
> As in:
>
> var myDiv = document.createElement('div');
> myDiv.id = 'something';
> swfobject.embedSWF('flash.swf', 'myDiv', ....);
> document.body.appendChild(myDiv);
>
> But that is not possible, as embedSWF is, for some reason that I don't
> really understand, expecting a div name and not a reference to an
> element.
>
> Additionally, it would be very nice to be able to do something like
>
> $('myDiv').embedSWF('myFlash.swf', ......);
>
> Thanks anyway :)
>
> >
> 

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to