I want to change the src attribute of an embed object. I have:
<embed class="flash "id="flash" src="swf/pano.swf?panoSrc=images/a.jpg"
allowFullScreen="true"
width="1280" height="640" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" bgcolor="#DDDDDD"/>
and I've tried
function change()
{
document.getElementById("flash").setAttribute('src', 'swf/pano.swf?panoSrc=b.jpg');
}
but it didn't work in Chrome, "only" in Firefox, IE and Opera. How can I fix it (to make it work in Chrome)? Did I do anything wrong?
EDIT: here is the whole HTML file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title></title>
<script>
function change() {
document.getElementById("flash").setAttribute('src', 'swf/pano.swf?panoSrc=a.jpg');
}
</script>
</head>
<body>
<embed class="flash" id="flash" src="swf/pano.swf?panoSrc=images/sau.jpg" allowFullScreen="true"
width="1280" height="640" quality="high"
pluginspage="http://www.macromedia.com/go/getflashplayer"
type="application/x-shockwave-flash" bgcolor="#DDDDDD"/>
<script>
change();
</script>
</body>
Link to the page: http://chin.comli.com/test.html
tag is usually the best
– AlienWebguy Oct 19 '12 at 00:29