Much later than my last post, and much more advanced questions, but: How do i set the variables of a duped movieclip in _root, from inside a different movie clip? (i'm making enemy bullets, and attempting to make them without using instance names) I tried everything, but it doesnt work. i have this on _root: enbc=1000;
onEnterFrame = function(){
if(enfire == true){
enbc++;
if(enbc>1100){ enbc=1000; }
duplicateMovieClip("enbullet", "eb"+enbc, enbc); //Create dupe bullet
}}
and have this on the bullet:
onClipEvent(enterFrame){
if(this.hitTest(_root.circle) && _root.fox.hurt._currentframe == 1 && !_root.block){
_root.circle.fall = true;
_root.circle.jump = _root.circle.jumpheight;
_root.circle.hold = true;
_root.remhp -= 5;
_root.fox.hurt.play();
this.removeMovieClip();
}
}
onClipEvent (load) {
speed = 25;
//bullet speed
//Move to gun _y
//Point in same direction as gun
}
onClipEvent (enterFrame) {
if (_xscale>0) {
_x += speed;
} else {
_x -= speed;
}
if (_name == "enbullet") {
_x = -1000;
//Move the original bullet MC offstage
}
if (_x>Stage.width || _x<0 || _y<0 || _y>Stage.height) {
//If off-stage, delete the dupe to save CPU
this.removeMovieClip();
}
if (_root.ground.hitTest(_x, _y, true)) {
this.removeMovieClip();
}
}
and this on the enemy for scripts (yes i do set enfire to true on the frame before this):
_root.enfire = false;
_root["eb"+_root.enbc]._x = _parent._x
_root["eb"+_root.enbc]._y= _parent._y;
any help would be appreciated, thanks!