embedSWF is for when page runs
use createSWF to insert swf into a div after page load
here is something adjusted from an past project, I was using links to enable
user to replace
the targetObj from a list of available items; this uses jquery to enable
things
var loadObj = function (e) {
e.preventDefault();
replaceSwfWithEmptyDiv('trgtObj');
// create the swf get
targetObj = swfobject.createSWF({ data:"target.swf", width:"300",
height:"300" }, par, "trgtObj");
$(targetObj).css('visibility', 'visible');
};
function replaceSwfWithEmptyDiv(targetID) {
var el = document.getElementById(targetID);
if(el){
var div = document.createElement("div");
el.parentNode.insertBefore(div, el);
//Remove the SWF
swfobject.removeSWF(targetID);
//Give the new DIV the old element's ID
div.setAttribute("id", targetID);
}
}
$(document).ready(function () {
var objLinks = $('#objBox ul').find('.playObjLinks');
objLinks.live('click', loadObj);
});
- S
On 6 March 2011 19:52, mikek12003 <[email protected]> wrote:
> Try to create an SWF rotator, in JS within a given set interval I use
> swfobject.embedSWF() to change the content of the target div. I had
> little time to read the documentation, is this way of embedding the
> best? more important do I have after each of these calls to embed a
> SWF to call someother to un-embeded before embeded the next swf? (even
> like this works fine but read somewhere if exists you must do it to
> free some memory) is there a buid-in way of doing this rotation?
>
> Thanks in advance
> Mike
>
> --
> 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.
>
>
--
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.