Here are instructions and an example for what you're trying to do: 1. embed SWF dynamically 2. remove SWF using removeSWF 3. reinsert an empty DIV, thereby allowing you to dynamically load another SWF
Instructions: http://pipwerks.com/lab/swfobject/load-onclick/2.0/index.html (see the section entitled "Using an 'onclick' event to replace a loaded SWF with another SWF") Example: http://pipwerks.com/lab/swfobject/load-onclick/2.0/onclick2.html - philip On Mon, Mar 23, 2009 at 5:11 AM, Getify Solutions, Inc. <get...@gmail.com>wrote: > > Yes, this is because the SWF *replaces* html content. Then removeSWF > actually *removes* the SWF. removeSWF() is not an "undo" of createSWF(). > These are one-way actions, meaning after you do them in sequence, there's > no > "going back" to the DOM the way it was before. > > So, to add another SWF in its place, you'll need to create another hook for > the swf to replace on the next call of createSWF/embedSWF. > > You could also check out other helper libraries that do some of this stuff > for you, if you don't want to do that coding yourself. I run a project > called CheckPlayer ( http://checkplayer.flensed.com ) that actually gives > you options of "appending" a SWF as a child of a container, which means you > can call it as many times as you want and not need to recreate DOM elements > for it to replace. What CheckPlayer does in that mode of operation is > create > dummy elements for you, before passing the call on to createSWF to replace > it. > > So, you can code that logic yourself, or use someone else's code. Those are > your best options. Hope that helps. > > --Kyle > > > > -------------------------------------------------- > From: "kunal" <kunal.pagar...@gmail.com> > Sent: Monday, March 23, 2009 2:40 AM > To: "SWFObject" <swfobject@googlegroups.com> > Subject: embedding swf file > > > > > Hi > > I am embedding swf file using SWFObject.createSWF() in html. Its > > working. Then i remove > > that Swf on button click event uisng SWFObject.removeSWF(). This also > > works. > > Now i want to load agian without loading html. Its giving error null > > is null or not an object > > > > help me > > Thanks > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "SWFObject" group. To post to this group, send email to swfobject@googlegroups.com To unsubscribe from this group, send email to swfobject+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/swfobject?hl=en -~----------~----~----~----~------~----~------~--~---