You should read this tutorial which describes how to invoke SWFObject methods onclick etc. It also talks about replacing 1 swf with another: http://www.pipwerks.com/lab/swfobject/load-onclick/2.0/index.html
Aran On Wed, Jun 3, 2009 at 5:59 PM, Frankensohn <[email protected]> wrote: > > Hi, > > is there someone out to help me solving the following problem? > > As you can see in the attached code there are 2 divs defined (vertNav > and swfBox). > > Depending on which button the event onmouseover occurs a particular > swf should be played automatically in div swfBox. > > If the event onmouseout occurs the SWFObject should be removed from > the div swfBox. > > For example: > > onmouseover occurs for button "Stefan Fitzner" -> > stefanfitzner_Typozeichen_S.swf should be played in div swfBox > onmouseout occurs for button "Stefan Fitzner" -> > stefanfitzner_Typozeichen_S.swf should be removed from the page. > > Thanks for helping in advance. > > Here's the code: > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// > www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <title>Stefans website</title> > <style type="text/css"> > <!-- > #vertNav { > position:absolute; > left:310px; > top:318px; > width:135px; > height:86px; > z-index:1; > } > #swfBox { > position:absolute; > left:446px; > top:318px; > width:268px; > height:86px; > z-index:2; > } > --> > </style> > <script type="text/javascript"> > <!-- > > function MM_swapImgRestore() { //v3.0 > var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i+ > +) x.src=x.oSrc; > } > function MM_preloadImages() { //v3.0 > var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); > var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; > i<a.length; i++) > if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a > [i];}} > } > > function MM_findObj(n, d) { //v4.01 > var p,i,x; if(!d) d=document; if((p=n.indexOf("?")) > >0&&parent.frames.length) { > d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} > if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) > x=d.forms[i][n]; > for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers > [i].document); > if(!x && d.getElementById) x=d.getElementById(n); return x; > } > > function MM_swapImage() { //v3.0 > var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; > for(i=0;i<(a.length-2);i+=3) > if ((x=MM_findObj(a[i]))!=null) > {document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; > x.src=a[i+2];} > } // end of function MM_swapImage() > > //--> > </script> > </head> > > <body onload="MM_preloadImages('Index/Register_Buttons/ > stefanfitzner_roll.gif','Index/Register_Buttons/ > referenzen_roll.gif','Index/Register_Buttons/neuemedien_roll.gif', > 'Index/Register_Buttons/foto_roll.gif','Index/ > Register_Buttons/grafik_typo_roll.gif','Index/Register_Buttons/ > bild_farbe_roll.gif')"> > <div id="vertNav"> > <a href="name_seite.html" onmouseout="MM_swapImgRestore()" > onmouseover="MM_swapImage('name','','Index/Register_Buttons/ > stefanfitzner_roll.gif',1)"> > <img src="Index/Register_Buttons/stefanfitzner_on.gif" > alt="Stefan Fitzner" name="name" width="135" height="11" border="0" > id="name" /></a> > > <a href="name_seite.html" onmouseout="MM_swapImgRestore()" > onmouseover="MM_swapImage('referenzen','','Index/Register_Buttons/ > referenzen_roll.gif',1)"> > <img src="Index/Register_Buttons/referenzen_on.gif" > alt="Referenzen" name="referenzen" width="135" height="11" vspace="4" > border="0" id="referenzen" /></a> > > <a href="name_seite.html" onmouseout="MM_swapImgRestore()" > onmouseover="MM_swapImage('neuemedien','','Index/Register_Buttons/ > neuemedien_roll.gif',1)"> > <img src="Index/Register_Buttons/neuemedien_on.gif" alt="Neue > Medien" name="neuemedien" width="135" height="11" border="0" > id="neuemedien" /></a> > > <a href="name_seite.html" onmouseout="MM_swapImgRestore()" > onmouseover="MM_swapImage('foto','','Index/Register_Buttons/ > foto_roll.gif',1)"> > <img src="Index/Register_Buttons/foto_on.gif" alt="Fotografie" > name="foto" width="135" height="11" vspace="4" border="0" id="foto" / > ></a> > > <a href="name_seite.html" onmouseout="MM_swapImgRestore()" > onmouseover="MM_swapImage('grafik_typo','','Index/Register_Buttons/ > grafik_typo_roll.gif',1)"> > <img src="Index/Register_Buttons/grafik_typo_on.gif" alt="Grafik/ > Typografie" name="grafik_typo" width="135" height="11" border="0" > id="grafik_typo" /></a> > > <a href="name_seite.html" onmouseout="MM_swapImgRestore()" > onmouseover="MM_swapImage('bild_farbe','','Index/Register_Buttons/ > bild_farbe_roll.gif',1)"> > <img src="Index/Register_Buttons/bild_farbe_on.gif" alt="Bild/ > Farbe" name="bild_farbe" width="135" height="11" vspace="4" border="0" > id="bild_farbe" /></a> > </div> > > <div id="swfBox"> </div> > > <p> </p> > </body> > </html> > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
