a) Can't you just generate the DIVs with ID's to match the SWFObject calls
if you are using PHP when you are writing out the page contents? This is
really the power of server-side languages...


b) If you can't for whatever reason, then you can use javascript to create a
target DIV dynamically like:

function createTargetDiv (parentID, id)
{
        var parent = document.getElementById(parentID)
        if(parent)
        {
                var swfdiv = document.createElement("div");
                swfdiv.setAttribute("id", id);
                // you can set CSS class etc here too 
                parent.appendChild(swfdiv);
        }
}


In regards to using the onload event, Can you use the built in
swfobject.addDomLoadEvent(fn) ?
http://code.google.com/p/swfobject/wiki/api

Example:
http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_api_adddomloade
vent.html


You can combine the above code with embedSWF() in a wrapper function to make
a div per swf you want to create and then embed into it.


Aran



-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of cobasa
Sent: Sunday, 18 January 2009 9:30 AM
To: SWFObject
Subject: call to embed or create swfobject with no container id


sorry, this is probably very basic and perhaps more js related than
swfobject.

i have php writing a series of swfobjects on one page. the info is
pulled from a database with hundreds of records. the problem i'm
having is that it's not feasible to have predefined container ids
defined like all the examples show in the documentation. this was easy
in the older version to work with.

is there somethign like a function i can call to dynamically write the
swfobject's container id?

i found http://pipwerks.com/lab/swfobject/load-onclick/2.0/index.html
, but this needs to happen onload and i can't call the onload event on
anything using xhtml strict.

any help is appreciated.



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