I think you missed the big change in my edit of your code. You don't need a 
reference to the DOM object itself. You need the ID ("something" in the 
example). that you assign to that DOM object. If you don't have the ID, you 
cannot use SWFObject.

--Kyle



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

>
>> Try this, as it should work:
>>
>> var myDiv = document.createElement('div');
>> myDiv.id = 'something';
>> document.body.appendChild(myDiv);
>> swfobject.embedSWF('flash.swf', 'something', ....);
>>
>
> Unfortunately, as specified in my first post, I'm inserting the div in
> the parent document from a script that resides in an iFrame by doing
>
> var target = window.parent.document;
> target.body.appendChild(myDiv);
>
> Meaning that I can modify the DOM of the parent from the iFrame and
> append the div, but I can't just put the reference to myDiv in the
> call to SWFObject, since that div resides in the parent,
> not the iFrame from where embedSWF is called.
> Thus my need to be able to specify a DOM path to the parent, something
> like embedSWF('myFlash.swf', target.getElementById('myDiv'),....)
>
> I' not sure if I'm being clear here, English isn't my native
> language :)
>
>> 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!)
>
> >
> 

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