Although keep in mind that that tutorial does what I warn about, which is destroying a flash movie and replacing it with another, invoking the load time for both every time you do a swap, I believe. Whereas if you use a method where you prefetch the movies and use dynamic positioning to move the movie offscreen, then you will get much better user "snappiness" on the swap.
Your mileage will of course vary depending on whether or not you have only 2 movies you are swapping vs. 100 and how you are doing the swapping specifically. It also lets you avoid the whole removeSWF/recreate div problem that SWFObject 2.x introduces --- which STILL confuses me as to why that convention was changed from the old, "just shove the object INSIDE the div identified as the container" method.... please bring it back? :) VP On Wed, Aug 12, 2009 at 5:16 AM, jim holmes <[email protected]>wrote: > > Thanks guys - much appreciated - will take a look at Phillip's tute as > that sounds like it could be what I need - > > cheers, > Jim > > On Aug 12, 12:38 pm, Aran Rhee <[email protected]> wrote: > > If you are wanting to swap flash movies within the same dic, yuou can > check > > out Philip's tutorial on the subject: > > > > http://pipwerks.com/lab/swfobject/load-onclick/2.0/index.html > > (section "Using an 'onclick' event to replace a loaded SWF with another > > SWF") > > > > Cheers, > > Aran > > > > On Wed, Aug 12, 2009 at 9:32 PM, Vincent Polite < > > > > > > > > [email protected]> wrote: > > > SWFObject is a javascript object that allows people to embed .swf files > in > > > their web pages. Among other things, there is a method called > .embedSWF > > > that takes arguments and puts a specific .swf file that you specify, > > > swapping it for a designated div. There's nothing stopping you from > calling > > > that function more than once. So depending on what you are using to > trigger > > > the action, it would be code on the order of: > > > > > if (action1) { > > > swfObject.embedSWF(...) > > > } else { > > > swfObject.embedSWF(...) > > > } > > > > > I would just be sure you are including the right version of the > > > swfObject.js script (version 2.x) and that should do the trick. > However, > > > the embed method depending on how you do it may reload the flash movie > each > > > time (not cached), which might be laggy and undesirable. > > > > > If I were doing something like this, I would define 2 divs in your HTML > > > page, one with an id="version1" and another with id="version2" > > > If I needed any of these divs on page, I would define my style sheet to > > > show it where it needed to be shown. If one or both of the divs need > to be > > > hidden, then I would define the style on that div so that the x and y > > > coordinates are off screen (like using huge negative numbers). > > > > > Then you write some script that would "move" the div onto the visible > part > > > of the page where you want it. You can simulate a Flash swap that way. > > > > > A lot depends on what you're trying to do. Using the method I > described > > > works perfectly fine for 2 flash movies, but it might not work so well > if > > > you had say 30... > > > > > Hope this points you in the right direction. If you do some google > > > searching, there was a post a day or so ago that discussed swapping a > Flash > > > movie using the technique I described. > > > > > Vincent > > > On Wed, Aug 12, 2009 at 4:20 AM, jim holmes <[email protected] > >wrote: > > > > >> This is all I want to do - it seems ( like a lot of things ) a > > >> relatively simple task, but 2 hours later I'm no further forward. One > > >> site recommended swfobject to do this, but I can find no reference to > > >> doing this anyway on this site? > > >> Am I looking to do something that can't be done? > > > > >> cheers > > >> Jim- Hide quoted text - > > > > - Show quoted text - > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
