ich habe folgendes Script geschrieben, und möchte nun die sich weiderholenden Anweisung in eine Funktion schreiben
so wie :
function eigenschaften(x)
{
setProperty(...
}
wobei x eine Integerzahl is
Code:
onClipEvent (load)
{
schritt = new Array(15);
for (x=1; x<15; x++)
{
duplicateMovieClip (_root.symbol, "q" add x, x);
setProperty ("/q" add x, _x, x*50);
setProperty ("/q" add x, _alpha, random(100));
_root["q"+ x]._width = random(100);
_root["qc"+x] = new Color("/q" add x);
n = 0xffffff;
_root["qc"+x].setRGB(random (n) );
schritt[x] = (random(30)+5);
}
}
onClipEvent (enterFrame)
{
for (x=1; x<15; x++)
{
if ( _root["q"+ x]._x > 700)
{
schritt[x] = (random(30)+5)*(-1);
_root["qc"+x].setRGB(random (n) );
setProperty ("/q" add x, _alpha, random(100));
_root["q"+ x]._width = random(100);
}
if (( _root["q"+ x]._x + _root["q"+ x]._width) < 0)
{
schritt[x] = (random(30)+5);
_root["qc"+x].setRGB(random (n) );
setProperty ("/q" add x, _alpha, random(100));
_root["q"+ x]._width = random(100);
}
_root["q"+ x]._x += schritt[x];
}
}
allerdings weiß ich nicht, wo ich diese Funktion hinschreiben soll, bei diesen Clipevents will er es nicht und in einem anderen Schlüsselbild wird's ignoriert ?