J'ai pour ce parterre fleuri simplement ce code (je pense que c'est de l'AS2)
gene = false;
this.onEnterFrame = function ()
{
if (gene)
{
++n;
topy = _root._ymouse - 20 - Math.random() * 100;
topx = _root._xmouse + Math.random() * 20 - 10;
this.attachMovie("kuki", "kuki" + n, n);
kukis = this["kuki" + n];
kukis._x = _root._xmouse;
kukis._y = _root._ymouse;
kukis._yscale = kukis._y - topy;
kukis._xscale = (topx - kukis._x) * 100 / 30;
hanakazu = Math.round(Math.random() * 8 + 4);
hanakakudo = 360 / hanakazu;
hanairo = Math.round(Math.random() * 8);
i = 1;
while (i < hanakazu + 1)
{
this.attachMovie("hanabira", "hanabira" + n * 1000 + i, n * 1000 + i);
hana = this["hanabira" + n * 1000 + i];
hana.gotoAndStop(hanairo);
hana._x = topx;
hana._y = topy;
hana._rotation = hanakakudo * i;
hana._xscale = hana._yscale = kukis._yscale / 2;
++i;
}
happakazu = Math.round(Math.random() * 8);
m = 0;
for (;<img src='http://forums.mediabox.fr/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
{
if (m >= happakazu)
{
return;
}
this.attachMovie("happa", "happa" + n * 100 + m, n * 100 + m);
happas = this["happa" + n * 100 + m];
happas._x = _root._xmouse;
happas._y = _root._ymouse;
happas._xscale = Math.random() * 40 - 20;
happas._yscale = kukis._yscale / 3 + Math.random() * 20 - 10;
++m;
}
}
}
;
this.onMouseDown = function ()
{
gene = true;
}
;
this.onMouseUp = function ()
{
gene = false;
}
;
et j'aimerai faire un fla en AS3. La souris suivrait donc les coordonnées afin de voir les fleurs se multiplier.
Comment pourrai-je le construire et le coder ?
Merci pour votre réponse.
Cate