dポイントプレゼントキャンペーン実施中!

お世話になります
以下のような画像入れ替えを使ってフラッシュなどの動画入れ替えは可能なのでしょうか
宜しくお願いします

<SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript非対応ユーザーの為に
function irekaeA(){
if (document.form1.pars[0].checked){
document.parsga.src="3-1.jpg"
}else{
if (document.form1.pars[1].checked){
document.parsga.src="3-2.jpg"
}else{
if (document.form1.pars[2].checked){
document.parsga.src="3-3.jpg"
}else{
if (document.form1.pars[3].checked){
document.parsga.src="3-4.jpg"
}else{
if (document.form1.pars[4].checked){
document.parsga.src="3-5.jpg"
}else{
document.parsga.src="3-6.jpg"
}
}
}
}
}
}
// -->
</SCRIPT>
<FORM NAME="form1">
<INPUT TYPE="radio" NAME="pars"
VALUE="pars1"onclick="irekaeA()" CHECKED>sample1
<INPUT TYPE="radio" NAME="pars"
VALUE="pars2"onclick="irekaeA()">sample2
<INPUT TYPE="radio" NAME="pars"
VALUE="pars3"onclick="irekaeA()">sample3
<INPUT TYPE="radio" NAME="pars"
VALUE="pars4"onclick="irekaeA()">sample4
<INPUT TYPE="radio" NAME="pars"
VALUE="pars5"onclick="irekaeA()">sample5
<INPUT TYPE="radio" NAME="pars"
VALUE="pars6"onclick="irekaeA()">sample6
</FORM><BR>
<IMG SRC="3-1.jpg" NAME="parsga" width="550" height="405">

A 回答 (2件)

検証してません。

それにしてもサンプルはすごいIF文!

<html>
<body>
<script>
function test(e){
if(e.name!='pars') return;
obj = document.getElementsByName(e.name);
for(var i=0,m=obj.length;i<m;i++){
if(obj[i].checked){
swapSWF(['001.swf','002.swf','003.swf'][i]);
break;
}
}
}
function swapSWF(swfName){
swfTag = '<embed src="'+swfName+'" width="320" height="240">';
document.getElementById("v").innerHTML = swfTag;
}

</script>

<form onClick="test(event.target || event.srcElement)">
<INPUT TYPE="radio" NAME="pars" VALUE="0" CHECKED>sample1
<INPUT TYPE="radio" NAME="pars" VALUE="1">sample2
<INPUT TYPE="radio" NAME="pars" VALUE="2">sample3
</form>
<div id="v">
<embed src="001.swf" width="320" height="240">
</div>
    • good
    • 0
この回答へのお礼

_pipi_さま
親切な回答有り難うございます
お陰様でアップ出来ました

本当に助かりました

また何か有りましたら、宜しく御願いします

rinchan-t

お礼日時:2008/09/14 19:59
    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!