At 1/27/08 04:10 PM, NG-Unit wrote:
Sorry for being such a noob, but this is my first time working with dupes, and I can't seem to get stuff right even if its obvious. So if you guys could help me on 3 things, it would be awesome, thanks!
1.) How to make them come in with a random vertical axis between 0 and 400, and make it start -400 for horizonal...I tried to do it like this:
_x= -400
_y= random (400)
but it didn't work
2.) how to get rid of the things. see my fla for what happens. But after you die, it goes to the next frame, but there are still objects on the screen, I tried
things+i.removeMovieClip
but it didn't work
3.) make it so that the things can get in, but once they are in, if they hit the edge (this on a border, btw) they bounce off of it...(look at the night of the ninja's to see what I mean, when the ninjas hit the border they bounce off)
thanks, here is an fla!
I know the sample is extremely simple, but you get whats happening with it, so it all works
don't tell me that the sample is bad artwork, cuz I just quick whipped that up so you can see the problem...
Im a noob too so dont feel bad man :)
Well, heres a few things I know. Heres the problem with removing your movieclips you duplicated:
removeMovieClip()
This method does not remove a movie clip assigned to a negative depth value. Movie clips created in the authoring tool are assigned negative depth values by default. To remove a movie clip that is assigned to a negative depth value, first use the MovieClip.swapDepths() method to move the movie clip to a positive depth value.
So that will fix your problem with that.
Looking at your .fla I noticed this:
function onEnterFrame() {
_root.things._x = 1000;
and in your things movie clip you have this:
onClipEvent (load) {
_x= 0
_y= random (Stage.height)
It seems as if your trying to set your movie clip to different places.
I also noticed your if command seemed odd as if it was using really old code (flash 5 version).
Same with your random function which has been replaced with math random.
I am pretty new at this as well, so I cant tell you right off hand what code to use to fix this, but hopefully I helped a little bit.
Good luck with this.