PDA

View Full Version : Spawing NPC's/Allies movieClipDuplicate Help



Outmodeduser
February 25th, 2009, 10:52 PM
Hello! I am working on a Beta for a game similar to armor alley, the Beta is basically me proving to myself i could actually make a game, but i digress. There is a movieClip on the stage that is a button you press (movieClip, not a button though) to deploy new Infantry, refrenced as "inf". Here is the following code on the button. Note onClipEnterframe ect is there, im not that dumb. Will it help to upload and .fla? Any help would be greatly apreciated! Thanks!

dupMovie = function () {
i = 0
newInf = _root.inf.duplicateMovieClip("infspanw"+i, i++); //probly bad code :(
newInf._x = Stage.width/1.3 //Just some point
i++;
if (i>25) {
i = 0
}
}
}
on (press) {
dupMovie();
}

Charleh
February 26th, 2009, 07:39 AM
You know what would help even more than the .fla...

The question!

pantas
February 26th, 2009, 08:21 AM
You know what would help even more than the .fla...

The question!

looooolll



delete that "i= 0" in the beggining of your function.

and the duplicateMovie function is wrong:
duplicateMovieClip(target:MovieClip, newname:String, depth:Number) : Void

Outmodeduser
February 26th, 2009, 03:04 PM
Ok the question is...
HOW DO I MAKE MORE THAN ONE COPY OF THE MOVIE CLIP. When i press the button, i will clone it once, and then replace the current copy with another press.

Jephz
February 26th, 2009, 03:37 PM
attachMovie()

Outmodeduser
February 26th, 2009, 03:57 PM
attachMovie()
Could someone show me use this, i know how the code works, but every time I tried it it returns errors. Thanks

Jephz
February 27th, 2009, 03:27 PM
http://www.newgrounds.com/bbs/topic/296646

That should cover duping and attaching movieclips.

Then if you want to learn it all:

http://www.newgrounds.com/bbs/topic/229808/9999

This should keep you busy =)