Monday, August 25, 2008

How to make javascript sub menus appear above flash objects?

Flash objects are considered to be "windows" on top of the browser and this is why they cover the submenus by default.
This can be easily changed by making the chnages to the HTML code.
The solution is to add a "opaque" attribute to the "<param>" parameter and "transparent" parameter inside your Flash object definition, as shown on the example below:

<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=10,1,1,0" width="806" height="200">
<param name="WMode" value="opaque">
<param name="movie" value="/images/header/test.swf">
<param name="quality" value="high">
<embed src="/images/header/test.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="806" height="200" wmode="transparent"></embed>
</object>

By adding the "Opaque" & "Transparent" parameter on both locations the submenus will always appear above Flash objects on all browsers.

How to change the font attributes dynamically using Javascript?

HTML code example:

<div align="center">
<font size="2" face="Times New Roman" color="#000000" id="field1"> Field Lable </font></p>
</div>

In the input box, you could call the function ChangeFont(size)

<SCRIPT LANGUAGE="JavaScript">
<!-- Heres the code to change the font
function ChangeFont(size)
{
text2.style.fontFamily="Arial";
text2.style.fontSize=size;
}-->
</SCRIPT>