Thanks for Your replies!
I've read that article that Philip mentions before but obviously not
careful enough so I had a new look at it:)
"see this link for more details about removeSWF:
http://learnswfobject.com/advanced-topics/load-a-swf-using-javascript...
(scroll down to *Replacing a loaded SWF with another SWF*) "
I changed my code to this:
swfobject.removeSWF('#myId');
$("#main-content").append(newDivFlashContent);
That seems to have solved the problem.
Actually, all browsers except IE worked fine with just this:
$('#myId').replaceWith(newDivFlashContent);
The removeSWF doesn't seem to be needed by other than IE??
I'm a bit puzzled about why the whole funtionality still worked when I
added the removeSWF before the .replaceWith() line...
Does that mean that the jQuery .replaceWith() works somehow even if
the id it is supposed to replace doesn't exist anymore?
I also changed this that Sam Sherlock mentioned:
"and lastly your loading jquery ui 1.8rc1 direct from jquery svn 1.8
is
available from google hosted api
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.min.js "
I had a look at this that Sam mentioned but could not quite digest
it...:
"swfobject.createSWF(attObj, parObj, replaceElemIdStr)
http://code.google.com/p/swfobject/wiki/api "
And this:
"the initial call to embed the swf is not in the head of the document
"
The reason I'm not doing this is that the movies are published
dynamically through the use of Wordpress Custom Fields.
The custom fields are placed in the body. I'm sure there is a way to
make it all happen in the header but that would mean I'd have to
rebuild a lot of everything.
Luckily it works anyway:)
- Håkan
On Apr 6, 6:12 am, Philip Hutchison <[email protected]> wrote:
> i see you have your swfobject.removeSWF() call immediately followed by a
> jQuery replaceWith() call
>
> since they're both targeting the same ID, you're bound to have trouble.
> swfobject.removeSWF will completely destroy the DOM element with the
> specified ID. this means the following code (copied form your page) should
> fail:
>
> swfobject.removeSWF('#myId');
> $('#myId').replaceWith(newDivFlashContent);
>
> because the element with the ID "#myId" should have been completely erased
> from the page before replaceWith is invoked.
>
> see this link for more details about
> removeSWF:http://learnswfobject.com/advanced-topics/load-a-swf-using-javascript...
> (scroll down to *Replacing a loaded SWF with another SWF*)
>
> - philip
>
>
>
> On Mon, Apr 5, 2010 at 6:10 PM, hawken1 <[email protected]> wrote:
> > Hi,
>
> > I've made this page:http://www.thefilmdivision.com
>
> > all pages are populated by flashmovies with html content on top of
> > them.
> > when clicking a movie link, a new movie is loaded without reloading
> > the page.
> > Everything seems to work fine in all browsers except Internet
> > Explorer.
>
> > In internet Explorer 7 and 8, the sound of the first movie starts
> > again after a while on top of the sound of the current movie...
>
> > It seems like the removeSWF is not working properly for IE or am I
> > doing something wrong.
> > All movies are looped with actionscript.
>
> > How can I solve this?
>
> > Best regards/Håkan Folkesson
>
> > --
> > 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]<swfobject%2bunsubscr...@googlegroups
> > .com>
> > .
> > 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.