function createflowerblast(i) {
_root.createEmptyMovieClip("flower"+i, i+100)._x = _xmouse;
_root["flower"+i]._y = _ymouse;
_root["flower"+i].leafconfig = [Math.round(Math.sqrt(Math.random()*80))+3, Math.round((Math.random()*2+1))*3];
_root["flower"+i][leafpoint+(0)] = -Math.sqrt(Math.random()*100)*10;
for (k=1; k<=_root["flower"+i].leafconfig[1]; k++) {
_root["flower"+i][leafpoint+k] = _root["flower"+i][leafpoint+(k-1)]-Math.sqrt(Math.random()*100)*3+5;
_root["flower"+i].leafsize += _root["flower"+i][leafpoint+k];
}
_root["flower"+i].createEmptyMovieClip("leaf"+0, 10).lineStyle(1, 0x990000, 50);
_root["flower"+i]["leaf"+0].beginGradientFill("radial", [parseInt(("0x"+(Math.round(Math.random()*239+16)).toString(16)+"ff"+(Math.round(Math.random()*239+16)).toString(16))), parseInt(("0x"+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16))), parseInt(("0x"+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16))), parseInt(("0x"+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16))), parseInt(("0x"+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16))), parseInt(("0x"+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16)+(Math.round(Math.random()*155+100)).toString(16)))], [80, 80, 80, 80, 80, 80], [0, 60, 100, 140, 180, 255], {matrixType:"box", x:(-_root["flower"+i].leafsize)/2-10, y:(-_root["flower"+i].leafsize)/2-10, w:_root["flower"+i].leafsize+20, h:_root["flower"+i].leafsize+20, r:(0/180)*Math.PI});
for (_root["flower"+i]._xscale=_root["flower"+i]._yscale=k=1; k<=(_root["flower"+i].leafconfig[1]); k += 2) {
_root["flower"+i]["leaf"+0].curveTo(Math.sqrt(_root["flower"+i].leafconfig[1]-k)*-15, _root["flower"+i][leafpoint+k], Math.sqrt(_root["flower"+i].leafconfig[1]-(k+1))*-15, _root["flower"+i][leafpoint+(k+1)]);
}
for (k=(_root["flower"+i].leafconfig[1])-1; k>1; k -= 2) {
_root["flower"+i]["leaf"+0].curveTo(Math.sqrt(_root["flower"+i].leafconfig[1]-k)*15, _root["flower"+i][leafpoint+k], Math.sqrt(_root["flower"+i].leafconfig[1]-(k-1))*15, _root["flower"+i][leafpoint+(k-1)]);
}
_root["flower"+i]["leaf"+0].curveTo(Math.sqrt(_root["flower"+i].leafconfig[1]-k)*15, _root["flower"+i][leafpoint+k], 0, 0);
for (j=1; j<_root["flower"+i].leafconfig[1]; j++) {
_root["flower"+i]["leaf"+0].duplicateMovieClip("leaf"+j, j+10)._rotation = j*(360/_root["flower"+i].leafconfig[1]);
}
}
_root.onEnterFrame = function() {
for (n=_root.rootArr[1]-5; _root.rootArr[0] != 1 && n<=_root.rootArr[1]; n++) {
_root["flower"+n]._xscale = _root["flower"+n]._yscale=Math.pow((_root["flower"+n].grow += 1000000), 0.15);
}
if ((_root.rootArr[0] == 1 && (_root.rootArr[1]>5 && _root.rootArr[2]++)) || _root.rootArr[2] == undefined) {
for (n=_root.rootArr[2]; n<=_root.rootArr[2]+20; n++) {
_root["flower"+(n)]._alpha -= 5;
}
_root["flower"+(_root.rootArr[2]-50)].removeMovieClip();
(_root.rootArr[2] == undefined || _root.rootArr[2]>_root.rootArr[1]+51) ? _root.rootArr=[0, 0, -20] : 1;
}
};
_root.onMouseMove = function() {
(_root.rootArr[0] != 1) ? createflowerblast(++_root.rootArr[1]) : 1;
};
_root.onMouseDown = function() {
_root.rootArr[0] = 1;
};
nothing I haven’t done before, but with some small improvements.
let me know if the code compression level is too high
I’ve an intermediate diploma test on wednesday, so I should do something else than flash :azn:
see also
[COLOR=“DarkOrange”]->sharks
->Bf compiler/interpreter[/COLOR]