friz2002
12-11-2002, 10:41 PM
Hi,
I have a mc on the mzin timeline that is moving to the right, when it reaches a certain point, it goes back to it's original x position, with a random y position and duplicates 10 times.
No problem so far.
What I would like is that the "new" mc's do the same as the first. So, move to the right, reposition, etc
this is what I have so far, but only the original mc moves and repositions...
naarRechts = function(){
this._x += this.speed;
this.teVer();
}
teVer = function(){
if(this._x>=500){
this._x = -33;
this.dup();
}
}
dup = function(){
i=0
while(i<10){
duplicateMovieClip(_root.raket_mc,"raket"+i+"_mc",i);
setProperty ("raket"+i+"_mc", _y, random(275));
setProperty ("raket"+i+"_mc", _x, random(275));
setProperty ("raket"+i+"_mc",_xscale, random(200)+50);
i++;
}
}
sneller = function(){
this.speed +=10;
}
_root["raket"+i+"_mc"].speed = 5;
_root["raket"+i+"_mc"].onEnterFrame = naarRechts;
_root["raket"+i+"_mc"].teVer = teVer;
_root["raket"+i+"_mc"].dup = dup;
_root["raket"+i+"_mc"].onKeyDown = sneller;
Key.addListener(_root["raket"+i+"_mc"]);
Thx
I have a mc on the mzin timeline that is moving to the right, when it reaches a certain point, it goes back to it's original x position, with a random y position and duplicates 10 times.
No problem so far.
What I would like is that the "new" mc's do the same as the first. So, move to the right, reposition, etc
this is what I have so far, but only the original mc moves and repositions...
naarRechts = function(){
this._x += this.speed;
this.teVer();
}
teVer = function(){
if(this._x>=500){
this._x = -33;
this.dup();
}
}
dup = function(){
i=0
while(i<10){
duplicateMovieClip(_root.raket_mc,"raket"+i+"_mc",i);
setProperty ("raket"+i+"_mc", _y, random(275));
setProperty ("raket"+i+"_mc", _x, random(275));
setProperty ("raket"+i+"_mc",_xscale, random(200)+50);
i++;
}
}
sneller = function(){
this.speed +=10;
}
_root["raket"+i+"_mc"].speed = 5;
_root["raket"+i+"_mc"].onEnterFrame = naarRechts;
_root["raket"+i+"_mc"].teVer = teVer;
_root["raket"+i+"_mc"].dup = dup;
_root["raket"+i+"_mc"].onKeyDown = sneller;
Key.addListener(_root["raket"+i+"_mc"]);
Thx