Folgendes funktioniert:
HTML-Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>valid xhtml1.0-strict</title>
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
* {
margin:0;
padding:0;
}
html,
body {
width:100%;
height:100%;
}
div {
width: 100%;
height: 100%;
position:absolute;
}
object {
display:block;
width: 100%;
height: 100%;
}
/*]]>*/-->
</style>
</head>
<body>
<div style="z-index:0;position:fixed;">
<object type="application/x-shockwave-flash" data="back.swf">
<param name="movie" value="test.swf" />
<param name="wmode" value="transparent" />
</object>
</div>
<div id="layer" style="z-index:100;" >
<table style="background-color:#FFFFFF; width:700px;height:100%;margin:auto;margin-top:30px;">
<tr>
<td valign="top">Platz für den Inhalt!</td>
</tr>
</table>
</div>
</body></html>
Das flash file:
PHP-Code:
Stage.align = "TL";
Stage.scaleMode = "noScale";
import flash.display.*;
import flash.geom.*;
import flash.filters.ColorMatrixFilter;
Stage.addListener(_root);
_root.onResize = function() {
_root.drawit();
};
var test:BitmapData = BitmapData.loadBitmap("test");
var IDENTITY:Array = Array(1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0);
var matrix:Array = IDENTITY.concat();
var hue:Number = random(30);
var test2:BitmapData = new BitmapData(8, 8);
var point:Point = new Point(0, 0);
var m:Matrix = new Matrix(1, 0, 0, 1, 0, 0);
var f:ColorMatrixFilter = new ColorMatrixFilter(matrix);
function drawit() {
if (hue>30) {
hue = 0;
}
adjustHue(hue++);
delete f.matrix;
f.matrix = matrix;
test2.dispose();
test2 = new BitmapData(8, 8);
test2.applyFilter(test, test.rectangle, point, f);
_root.beginBitmapFill(test2, m, true);
_root.moveTo(0, 0);
_root.lineTo(Stage.width, 0);
_root.lineTo(Stage.width, Stage.height);
_root.lineTo(0, Stage.height);
_root.lineTo(0, 0);
_root.endFill();
}
function adjustHue(angle:Number):Void {
angle *= Math.PI/180;
var c:Number = Math.cos(angle);
var s:Number = Math.sin(angle);
var f1:Number = 0.213;
var f2:Number = 0.715;
var f3:Number = 0.072;
var mat:Array = Array((f1+(c*(1-f1)))+(s*(-f1)), (f2+(c*(-f2)))+(s*(-f2)), (f3+(c*(-f3)))+(s*(1-f3)), 0, 0, (f1+(c*(-f1)))+(s*0.143), (f2+(c*(1-f2)))+(s*0.14), (f3+(c*(-f3)))+(s*-0.283), 0, 0, (f1+(c*(-f1)))+(s*(-(1-f1))), (f2+(c*(-f2)))+(s*f2), (f3+(c*(1-f3)))+(s*f3), 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
var temp:Array = Array();
var i:Number = 0;
for (var y:Number = 0; y<4; y++) {
for (var x:Number = 0; x<5; x++) {
temp[i+x] = mat[i]*matrix[x]+mat[i+1]*matrix[x+5]+mat[i+2]*matrix[x+10]+mat[i+3]*matrix[x+15]+(x == 4 ? mat[i+4] : 0);
}
i += 5;
}
delete matrix;
matrix = temp;
}
_root.drawit();
drawit wird regelmäßig ausgeführt, das geladene Bild ist ein kleines Kachelbild. Man kann aber ein beliebiges swf nehmen. Mein Problem ist die Performance. Hat jemand ne Idee, wie man das verbessern kann? Wenn man die Seite scrollt geht das sehr langsam. Ich hab allerdings noch nicht getestet, ob das überhaupt am swf liegt oder am Umstand, wie man es benutzt. Vielleicht hat jemand Lust das mal zu testen.
mfg Neon