Forum Topic: why isnt is removing the clip?

(105 views • 5 replies)

This topic is 1 page long.

<< < > >>
None

CrustySheet

Reply To Post Reply & Quote

Posted at: 11/24/08 09:07 AM

CrustySheet LIGHT LEVEL 03

Sign-Up: 05/03/06

Posts: 534

i thought i had it right but i guess not can anyone help

setInterval (function () {
	duplicateMovieClip(rock,"rock"+i,100+i);
	rockCopy=_root["rock"+i]
	rockCopy._x = 700;
	rockCopy._y = random(100)+200;
		if(rockCopy._x <= 50){
			removeMovieClip(this);
		}
	 i++
}, 1000);

None

WolfAkela

Reply To Post Reply & Quote

Posted at: 11/24/08 09:29 AM

WolfAkela LIGHT LEVEL 08

Sign-Up: 12/19/05

Posts: 2,327

Try tracing its depth. trace(MC.getDepth()). See what you get.


None

Cojones893

Reply To Post Reply & Quote

Posted at: 11/24/08 09:32 AM

Cojones893 EVIL LEVEL 22

Sign-Up: 03/09/03

Posts: 2,596

You are setting the objects _x to 700 then checking to see if its less than 50. That if statement will never run.


None

CrustySheet

Reply To Post Reply & Quote

Posted at: 11/24/08 09:51 AM

CrustySheet LIGHT LEVEL 03

Sign-Up: 05/03/06

Posts: 534

there is code on the enterFrame that moves its _x -=30


None

Cojones893

Reply To Post Reply & Quote

Posted at: 11/24/08 10:14 AM

Cojones893 EVIL LEVEL 22

Sign-Up: 03/09/03

Posts: 2,596

At 11/24/08 09:51 AM, CrustySheet wrote: there is code on the enterFrame that moves its _x -=30

Thats all well and good but the if statement will next check after it's created. Put that if statement inside your onEnterFrame.


None

UnknownFury

Reply To Post Reply & Quote

Posted at: 11/24/08 01:10 PM

UnknownFury EVIL LEVEL 26

Sign-Up: 08/10/05

Posts: 6,028

Cojones is correct. You're only checking it when its first created, at which point its _x is 700.

Portfolio(Under construction): UnknownFury.com |
Msn: giant_ak_47@msn.com | Contact: me@unknownfury.com
Follow me on twitter!


All times are Eastern Standard Time (GMT -5) | Current Time: 05:58 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!