rfl
03-30-2002, 11:52 PM
i have a mc that is dragable; i also have a button that sends the playhead to frame 2 where it randomly duplicates the mc; when the duplication is performed, all the "clones" are dragable except one; why?
the mc code is:
----------------------------------------
onClipEvent (load) {
this._x = random(300);
this._y = random(300);
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.startDrag(false);
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.stopDrag(false);
}
}
-------------------------------------------
the frame code is:
-------------------------------------------
amount = random(10);
trace(amount);
while(amount>0) {
duplicateMovieClip (ca, "ca"+i, i);//ca is the instance name of the mc
i = i + 1;
amount = amount-1;
}
------------------------------------------
the mc code is:
----------------------------------------
onClipEvent (load) {
this._x = random(300);
this._y = random(300);
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.startDrag(false);
}
}
onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.stopDrag(false);
}
}
-------------------------------------------
the frame code is:
-------------------------------------------
amount = random(10);
trace(amount);
while(amount>0) {
duplicateMovieClip (ca, "ca"+i, i);//ca is the instance name of the mc
i = i + 1;
amount = amount-1;
}
------------------------------------------