einige kennen ja vielleicht mein, "problem" aus dem anderen treat, wie auch immer ich hab eine lösung gefunden, die allerdings sehr rechenaufwendig ist, gibt es vielleicht ne lösung das ganze einfacher bzw. schneller ablaufen zu lassen.
besonders rechenaufwendig ist die "shootout" funktion wenn sie in das "on enter frame" kommt dann hab ich mit glück 1 frame pro sek... und dadruch ist es keine fliesende bewegung mehr was sie egentlich sein sollte...
ActionScript:
function makematrix(nam, posx, posy, x, y, color, depth, color2, field2) {
_root.createEmptyMovieClip(nam, depth);
p = 0;
for (i=1; i<=x; i++) {
for (j=1; j<=y; j++) {
if (p == 0) {
_root[nam].createEmptyMovieClip("x"+i+"_"+j, p++);
with (_root[nam]["x"+i+"_"+j]) {
beginFill("0x"+color, 100);
lineStyle(0, "0x"+color, 0);
lineTo(0, 0);
lineTo(5, 0);
lineTo(5, 5);
lineTo(0, 5);
lineTo(0, 0);
endFill;
}
} else {
_root[nam]["x1_1"].duplicateMovieClip("x"+i+"_"+j, p++);
for (h=0; h<field2.length; h++) {
if (field2[h] == i || field2[h] == j) {
my_color = new Color(_root[nam]["x"+i+"_"+j]);
my_color.setRGB("0x"+color2);
}
}
}
with (_root[nam]["x"+i+"_"+j]) {
_x = posx+(5*i);
_y = posy+(5*j);
}
}
}
}
makematrix("field", 150, 110, 71, 71, "00ff00", 100, "ff00ff", Array(24, 48));
function shootout(nam, sx, sy, ex, ey, speed) {
counter = 0;
for (i=sx; i<=ex; i++) {
for (j=sy; j<=ey; j++) {
}
}
_root.onEnterFrame = function() {
for (e=0; e<speed; e++) {
if (counter<total) {
_root[nam][
"x"+
pr[r]].
_alpha =
0;
counter++;
} else {
delete _root.onEnterFrame;
}
}
};
}
start = false;
_root.but.onRollOver = function() {
trace("Rollover!");
if (start == false) {
shootout("field", 24, 24, 71, 71, 73);
}
start = true;
};