1 Reply Latest reply on Jul 9, 2009 2:45 PM by Alan Gross

    swf movie in mediaOutput - switch movie with AJAX reRender?

    Alan Gross Newbie

      Hi Forum

      I'm using the mediaOutput to show a Flash movie.
      Now I would like to switch the movie dynamically. I provide a drop down with movie names and a button to start the movie. I thought I could do it with a Ajax reRender but this seems not to work.

      Here is my page:

      <t:div id="helpMovie">
       <h:panelGrid id="helpMovies">
       <h:outputLabel value="#{cont.lblHelpMovieSelect}" rendered="true" />
      
       <rich:comboBox id="movieSelect"
       defaultLabel="#{cont.dropDownDefaultMovieSelect}"
       value="#{helpHandler.movieSelected}" style="width: 90%"
       selectFirstOnUpdate="false" listHeight="100" listWidth="300"
       enableManualInput="false" rendered="true" required="false">
       <f:selectItems value="#{helpHandler.movieList }" />
       </rich:comboBox>
       <a4j:commandButton value="#{cont.lblHelpShow}" rendered="true"
       reRender="flashPanelDynamic"/>
      
       </h:panelGrid>
      
      
      
       <a4j:outputPanel id="flashPanelDynamic">
       <script type="text/javascript"
       src="#{facesContext.externalContext.requestContextPath}/scripts/swfobject.js" />
      
      
       <a4j:mediaOutput element="a" id="swfLink" style="display: none;"
       cacheable="false" session="true"
       createContent="#{helpHandler.startVideo}" value="#{mediaData}" />
      
       <a4j:outputPanel layout="block" id="myFlashContent"
       style="width: 200px; height: 200px">
       <a href="http://www.adobe.com/go/getflashplayer"> <img
       src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
       alt="Get Adobe Flash player" /> </a>
       </a4j:outputPanel>
      
      
       <script type="text/javascript">
      
       var flashvars = {};
       var params = {};
       params.scale = "noscale";
       params.allowfullscreen = "false";
       params.loop = "false";
       params.play = "true";
       var attributes = {};
       swfobject.embedSWF(#{rich:element('swfLink')}.href, "#{rich:clientId('myFlashContent')}", "800", "800", "9.0.0", false, flashvars, params, attributes);
       </script>
      
       </a4j:outputPanel>
      
      
      
      
      
       </t:div>
      
      
      
       </t:div>
      
       <t:saveState value="#{helpHandler.movieSelected}" />
      


      Does anyone know how I have to do this?

      Thank you and Rgds
      Alan