• 0
Sign in to follow this  
ThinkBrunus

Manipulando ("<object Classid

Question

Boas estou a tentar com o código abaixo que o objecto (animação em flash) dá para variar consoante o item que é clicado no menu principal da página.

ou seja, tou a utilizar hotsopts e ai estou a fazer: <....onclick="java script:mnu(1)">

para ser sincero estou a ver que isto tá a ser uma aventura, e assim peço a vossa opinião

<script language="javascript">
function mnu(val){
if (val==0){
write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" 
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" 
width=\"363\" height=\"50\">")
write("<param name=\"movie\" value=\"Anim/home.swf\">")
write("<param name=\"quality\" value=\"high\">")
write("<param name=\"wmode\" value=\"transparent\"/>")
write("<embed src=\"Anim/home.swf\" quality=\"high\"pluginspage=\"http://www.macromedia.com/go/getflashplayer\"
type=\"application/x-shockwave-flash\" width=\"363\" height=\"50\"></embed>");
write("</object>");
}
else if (val==1){
write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\" 
width=\"363\" height=\"50\">")
write("<param name=\"movie\" value=\"Anim/equipa.swf\">")
write("<param name=\"quality\" value=\"high\">")
write("<param name=\"wmode\" value=\"transparent\"/>")
write("<embed src=\"Anim/equipa.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\"
type=\"application/x-shockwave-flash\" width=\"363\" height=\"50\"></embed>");write("</object>");
}
}
</script>

Share this post


Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0
<script language="javascript">
function mnu(val){
if (val==0){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\width=\"363\" height=\"50\">");
document.write("<param name=\"movie\" value=\"Anim/home.swf\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\"/>");
document.write("<embed src=\"Anim/home.swf\" quality=\"high\"pluginspage=\"http://www.macromedia.com/go/getflashplayer\type=\"application/x-shockwave-flash\" width=\"363\" height=\"50\"></embed>");
document.write("</object>");
}
else if (val==1){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\width=\"363\" height=\"50\">");
document.write("<param name=\"movie\" value=\"Anim/equipa.swf\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\"/>");
document.write("<embed src=\"Anim/equipa.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\type=\"application/x-shockwave-flash\" width=\"363\" height=\"50\"></embed>");
document.write("</object>");
}
}
</script>

<input type="button" value="Testar" onclick="mnu(1)">

Share this post


Link to post
Share on other sites
  • 0

brigado andreia assim tá funcionando.

só um aspecto que não referi, é que estas animações apareçam dentro de uma layer. como está ele abre uma página nova.

o código que postei tava dentro da layer e a actualização também está, ele deveria mudar sempre dessa layer certo?

o código actualizado

<div id="Layer3" style="visibility:visible">
<script language="javascript">
var val
function mnu(val){
if (val==0){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\width=\"363\" height=\"50\">");
document.write("<param name=\"movie\" value=\"Anim/home.swf\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\"/>");
document.write("<embed src=\"Anim/home.swf\" quality=\"high\"pluginspage=\"http://www.macromedia.com/go/getflashplayer\type=\"application/x-shockwave-flash\" width=\"363\" height=\"50\"></embed>");
document.write("</object>");
}
else if (val==1){
document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\width=\"363\" height=\"50\">");
document.write("<param name=\"movie\" value=\"Anim/equipa.swf\">");
document.write("<param name=\"quality\" value=\"high\">");
document.write("<param name=\"wmode\" value=\"transparent\"/>");
document.write("<embed src=\"Anim/equipa.swf\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\type=\"application/x-shockwave-flash\" width=\"363\" height=\"50\"></embed>");
document.write("</object>");
}
}
</script>
aqui o link do map:
<map name="Map" onClick="mnu(0)">
<area shape="rect" coords="18,10,64,26" href="home.html" target="MyFrame">
</map>

<map name="btnEquipaMap" onClick="mnu(1)">
  <area shape="rect" coords="34,8,86,26" href="equipa.html" target="MyFrame">
</map>

Share this post


Link to post
Share on other sites
  • 0

a única ligação que o site tem com o iframe são estas dos map's, estes maps(hotspots) referem-se ao texto dos botões que são o menu do site

<map name="Map" onClick="mnu(0)">

<area shape="rect" coords="18,10,64,26" href="home.html" target="MyFrame">

</map>

<map name="btnEquipaMap" onClick="mnu(1)">

<area shape="rect" coords="34,8,86,26" href="equipa.html" target="MyFrame">

</map>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this