Frame 1
function onKeyDown() {
switch (Key.getCode()) {
case 38 :
scl = scl * 1.03;
return;
case 40 :
scl = scl * 0.96;
return;
case 37 :
r = r - 0.01;
return;
case 39 :
r = r + 0.01;
return;
case 187 :
slices = slices + 2;
angle = Math.PI / slices;
return;
case 189 :
if (slices > 4) {
slices = slices - 2;
angle = Math.PI / slices;
}
return;
case 49 :
rotate1 = !rotate1;
return;
case 50 :
rotate2 = !rotate2;
return;
case 51 :
rotate3 = !rotate3;
return;
case 52 :
flip = !flip;
return;
case 53 :
sh1 = sh1 + 0.04;
return;
case 54 :
sh1 = sh1 - 0.04;
return;
case 55 :
sh2 = sh2 + 0.04;
return;
case 56 :
sh2 = sh2 - 0.04;
return;
case 78 :
sclfact = sclfact + 0.01;
return;
case 77 :
sclfact = sclfact - 0.01;
return;
case 48 :
sclfact = 0;
return;
case 81 :
rotspeed1 = rotspeed1 + 0.001;
return;
case 87 :
rotspeed1 = rotspeed1 - 0.001;
return;
case 65 :
rotspeed2 = rotspeed2 + 0.001;
return;
case 89 :
rotspeed3 = rotspeed3 + 0.001;
return;
case 88 :
rotspeed3 = rotspeed3 - 0.001;
return;
case 69 :
rotspeed1 = 0;
return;
case 68 :
rotspeed2 = 0;
return;
case 67 :
rotspeed3 = 0;
return;
case 83 :
rotspeed2 = rotspeed2 - 0.001;
}
}
function onEnterFrame() {
if (rotate1) {
r = r + rotspeed1;
}
if (rotate2) {
r2 = r2 - rotspeed2;
}
if (rotate3) {
rot = rot + rotspeed3;
}
var _local1 = 0;
while (_local1 < slices) {
m.identity();
m.b = m.b + sh1;
m.c = m.c + sh2;
m.rotate(r2);
m.translate((2 * _xmouse) / scl, ((2 * _ymouse) / scl) + ((_local1 * sclfact) * 10));
m.rotate(r);
m.scale(scl, scl);
slice.clear();
slice.lineStyle();
slice.moveTo(0, 0);
slice.beginBitmapFill(stampImage, m);
slice.lineTo(Math.cos((angle + nudge) - (Math.PI/2)) * diag, Math.sin((angle + nudge) - (Math.PI/2)) * diag);
slice.lineTo(Math.cos((-(angle + nudge)) - (Math.PI/2)) * diag, Math.sin((-(angle + nudge)) - (Math.PI/2)) * diag);
slice.lineTo(0, 0);
slice.endFill();
m.identity();
if (flip && ((_local1 % 2) == 1)) {
m.scale(-1, 1);
}
m.rotate(rot + ((_local1 * angle) * 2));
m.translate(hsize * 0.5, vsize * 0.5);
map.draw(slice, m, null, "normal", null, true);
_local1++;
}
}
_quality = "BEST";
var hsize = 500;
var vsize = 500;
var diag = (Math.sqrt((2 * hsize) * hsize) * 0.62);
var map = (new flash.display.BitmapData(hsize, vsize, true, 0));
var mapHolder = createEmptyMovieClip("mapHolder", 1);
var code;
mapHolder.attachBitmap(map, 0);
var image = flash.display.BitmapData.loadBitmap("image");
var stampImage = (new flash.display.BitmapData(image.width, image.height, false));
stampImage.draw(image, new flash.geom.Matrix(0.5, 0, 0, 0.5, 0, 0), null, "normal", null, true);
stampImage.draw(image, new flash.geom.Matrix(-0.5, 0, 0, 0.5, image.width, 0), null, "normal", null, true);
stampImage.draw(image, new flash.geom.Matrix(0.5, 0, 0, -0.5, 0, image.height), null, "normal", null, true);
stampImage.draw(image, new flash.geom.Matrix(-0.5, 0, 0, -0.5, image.width, image.height), null, "normal", null, true);
image.dispose();
var rotate1 = false;
var rotate2 = false;
var rotate3 = false;
var flip = true;
var singleview = true;
var slice = createEmptyMovieClip("slice", 0);
slice._visible = false;
var slices = 12;
var angle = (Math.PI / slices);
var nudge = 0.009;
var rotspeed1 = 0.007;
var rotspeed2 = -0.003;
var rotspeed3 = -0.005;
var sclfact = 0;
var rot = 0;
var r = 0;
var r2 = 0;
var sh1 = 0;
var sh2 = 0;
var scl = 1;
var m = (new flash.geom.Matrix());
Key.addListener(this);