I eventually got it to work! (Flash8, I.E 7)
Here's the answer explained for anyone else that needs it!
But I changed it a little to make it toggle......
What i've done is made the "operator" div hidden on page load with a css class attached to the div to start with:
in css file:
Code: ( text )
.clearfix:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
then in flash:
ive got a button on the stage with:
Code: ( text )
on (press) {
import flash.external.ExternalInterface;
ExternalInterface.call("toggleLayer", "operator");
}
(i'm still researching AS3 regarding on (release) button and still getting my head around the new script - its quite hard to grasp!)
then in the html file, ive got a link to the css file and the javascript in the header telling it to toggle:
Code: ( text )
<head>
<link href="../css/SVW_css_test_1.css" rel="stylesheet" title="medium" type="text/css">
<script type="text/javascript">
function toggleLayer( whichLayer )
{
var elem, vis;
if( document.getElementById ) // this is the way the standards work
elem = document.getElementById( whichLayer );
else if( document.all ) // this is the way old msie versions work
elem = document.all[whichLayer];
else if( document.layers ) // this is the way nn4 works
elem = document.layers[whichLayer];
vis = elem.style;
// if the style.display value is blank we try to figure it out here
if(vis.display==''&&elem.offsetWidth!=undefined&&e lem.offsetHeight!=undefined)
vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block ':'none';
vis.display = (vis.display==''||vis.display=='block')?'none':'bl ock';
}
//-->
</script>
</head>
then i've got the div in the body with the class of clearfix to make it invisible on page load:
Code: ( text )
<div id="operator" class="clearfix">
Thanks!!
=)