| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
CurrentFlasher
Join Date: May 2005
Location: Finland
Posts: 382
|
Since the wmode transparent can cause a lot of issues on different browsers I'm starting a challence to create a generic way to "inherit" the background style definitions from the html.
The only way I can think of requires javascript similar to the next function from http://www.quirksmode.org/dom/getstyles.html Code:
<script language="javascript" type="text/javascript">
function getStyle(el,styleProp)
{
var x = document.getElementById(el);
if (x.currentStyle)
var y = x.currentStyle[styleProp];
else if (window.getComputedStyle)
var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
return y;
}
</script>
Here is my example that sort of works for bg color on Firefox (remember to include the js function into the header) Code:
if(flash.external.ExternalInterface.available==true){
var c=flash.external.ExternalInterface.call("getStyle","flash","background-color");
if(c){
var cs=c.substring(4,c.length-1).split(",");
var cn="0x"+Number(cs[0]).toString(16)+Number(cs[1]).toString(16)+Number(cs[2]).toString(16);
_root.moveTo(0,0);
_root.beginFill(cn);
_root.lineTo(0,Stage.width);
_root.lineTo(Stage.height,Stage.width);
_root.lineTo(Stage.height,0);
_root.endFill();
}
}
, If the bg color changes all flash emebds need to be edited.
__________________
Just that it hasn't been done before doesn't mean it's impossible. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| HTML in Flash MX | Mystro | ActionScript 1.0 (and below) | 1 | 10-10-2005 04:17 PM |
| in Flash it runs SMOOTH but in HTML it's SLOW !? | blaatorx | ActionScript 1.0 (and below) | 9 | 09-10-2005 08:11 PM |
| Loading movies between HTML frames | anticonnor | ActionScript 1.0 (and below) | 1 | 08-30-2005 02:46 AM |
| loading new HTML documents.... | tinonetic | ActionScript 1.0 (and below) | 4 | 10-30-2002 03:14 PM |
| Problem importing HTML formatted text | eye5 | Other Flash General Questions | 14 | 09-16-2002 06:43 AM |