2010-12-14 4 views
0

Je veux être en mesure de modifier le fichier swf montrant sur une page en utilisant le code ci-dessous (avec le commentaire transformé en véritable code)jquery pour changer swf

Est-ce possible ??

jquery:

$("div.360container > p").click(function() { 
    // show different swf by changing the value of the first param and src of the embed 
}); 

html:

<div class="mycontainer" style='padding:2px;'> 

    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="650" height="350"> 
    <param name="movie" value="/mySwf.swf" /> 
    <param name="quality" value="high" /> 
    <param name="wmode" value="opaque" /> 
    <embed src="/mySwf.swf" quality="high" wmode="opaque" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="650" height="350"></embed> 
    </object> 

    <p>click to change...</p> 
</div> 

Répondre

1

moyen le plus fiable de le faire serait de mettre innerHTML de l'élément à votre code HTML. Donc, en utilisant jquery:

$("div.360container > p").click(function() { 
    // show different swf by changing the value of the first param and src of the embed 
    $(".mycontainer").html("<object ....><param name='movie' value='" + movieUrl + "' />...."); 
}); 
Questions connexes