Click to See Complete Forum and Search --> : dhtml and flash integration
Misterq
05-27-2004, 12:20 PM
I have a dhtml site with a flash intro that covers part of the dhtml site. My problem is that I do not know of a code that will allow me to click on the flash area and make it disappear.
Something like...
<a href="#" onclick="jsShow('intro',0);return false;">
</a>
...is, I presume, what is necessary, but where do I insert that with respect to the <EMBED> tags?
Many thanks in advance
Ben
coothead
05-28-2004, 04:34 PM
Hi there Misterq,
You cannot click on the 'flash' directly and make it disappear.
It can be done like this....
<div id="foo">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="600" height="360"
<param name=movie value="yourflash.swf">
<param name=quality value=high
<param name="bgcolor" value="#000000">
<embed src="yourflash.swf" quality=high bgcolor="#000000"
type="application/x-shockwave-flash" width="600" height="360">
</embed>
</object>
</div>
You can then have a button...
<button onclick="document.getElementById('foo').style.display='none'">Off</button>
...or a link...
<a href="#" onclick="document.getElementById('foo').style.display='none'">Off</a>
coothead
Misterq
05-29-2004, 11:59 AM
Thanks for your reply!
Will the resulting link/button be ŽaboveŽ the flash, and if not, can it be made to be?
Cheers
Ben
coothead
05-29-2004, 12:52 PM
Hi there Misterq,
Pop the button into a div and then you can
position the button and the 'flash' precisely,
using 'css'. This code goes in the head section,
just adjust the values to suit....
<head>
<style type="text/css">
/*<![CDATA[*/
#button {
position:absolute;
top:100px;
left:200px;
}
#foo {
position:absolute;
top:150px;
left:200px;
}
/*//]]>*/
</style>
</head>
and your button and the 'flash' in the body...
<body>
<div id="button">
<button onclick="document.getElementById('foo').style.display='none'">Off</button>
</div>
<div id="foo">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
width="600" height="360">
<param name=movie value="yourflash.swf">
<param name=quality value=high
<param name="bgcolor" value="#000000">
<embed src="yourflash.swf" quality=high bgcolor="#000000"
type="application/x-shockwave-flash" width="600" height="360">
</embed>
</object>
</div>
</body>
...you can even style the button with 'css'
to match your design.
coothead