Click to See Complete Forum and Search --> : Embed to Img?


said_fox
06-03-2003, 09:12 PM
Hi,
Is there any way to change an embed swf file to an image file onMouseOver?
In other word, I want when the mouse is over a flash movie, it will changed to image, i.e some thing like image rollover but here the intial state is <embed src="file.swf">.
I asked for some thing arround this idea in the html section but I have not answer yet
http://forums.webdeveloper.com/showthread.php?s=&threadid=10456
So please help me
:(

Jona
06-04-2003, 12:57 AM
<a href="#" onmouseover="document.getElementById('MBD').src='image.jpg';" onmouseout="document.getElementById('MBD').src='file.swf';">Mouseover me</a><br>
<embed src="file.swf" id="MBD">
</embed>


Jona

said_fox
06-04-2003, 02:49 PM
:(
The problem is still available.
let we modify the question, can DHTML remove an html tag?
suppose
<embed src="file.swf" id="f1">
so by an event can we remove this embed?

Jona
06-04-2003, 02:52 PM
document.getElementById("f1").outerHTML="";


Jona

said_fox
06-04-2003, 03:20 PM
By the way, where can I find the manual of DOM or DHTML?

Jona
06-04-2003, 04:09 PM
I don't know about the manual, but here are a few manuals:

http://msdn.microsoft.com/workshop/author/dhtml/dhtml_node_entry.asp?frame=true
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsoriJScript.asp
http://devedge.netscape.com/
http://google.com/ (Search!)



Jona

said_fox
06-04-2003, 04:11 PM
:D :D
Good Good, it's the first time that I feel that DHTML has any control over the <EMBED>.
But there's a little quest,
What's the code sholud be involved into onMouseOut event handler to make the embed tag appeared again?

Jona
06-04-2003, 04:37 PM
You could instead put it inside a div and use id="myEmbeddedObj" and use document.getElementById("myEmbeddedObj").innerHTML=""; and then onmouseout document.getElementById("myEmbeddedObj").innerHTML="The embed object that was there before you took it off";

Or... You can use var emb = document.createElement("embed"); document.body.appendChild(emb); emb.setAttribute("id","f1"); emb.setAttribute("src","file.mid");

Jona