Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Self destructing Movieclips

(74 views • 9 replies)

This topic is 1 page long.

<< < > >>
None

imCoOkie

Reply To Post Reply & Quote

Posted at: 6/24/08 03:59 PM

imCoOkie NEUTRAL LEVEL 01

Sign-Up: 06/24/08

Posts: 4

Is it possible to have a movieclip destory it'self?

consider this persuedo example for a snowflake simulation. the movieclips are attached to the stage;

// this is placed inside every instance of the created movieclip.
this.y++;
if(this.y>400){
this.removeclip;
}

Any response would be appriciated as i don't want to track the movieclips in an array if possible.


None

souled

Reply To Post Reply & Quote

Posted at: 6/24/08 04:00 PM

souled NEUTRAL LEVEL 14

Sign-Up: 09/18/06

Posts: 1,528

this.removeMovieClip();

?


None

imCoOkie

Reply To Post Reply & Quote

Posted at: 6/24/08 04:01 PM

imCoOkie NEUTRAL LEVEL 01

Sign-Up: 06/24/08

Posts: 4

is that applicable to AS3?


None

imCoOkie

Reply To Post Reply & Quote

Posted at: 6/24/08 04:05 PM

imCoOkie NEUTRAL LEVEL 01

Sign-Up: 06/24/08

Posts: 4

besides, it doesn't remove the image, it just sits there were it was removed!


None

starBlinky

Reply To Post Reply & Quote

Posted at: 6/24/08 04:07 PM

starBlinky NEUTRAL LEVEL 06

Sign-Up: 09/24/04

Posts: 484

yeah its possible

onClipEvent(enterFrame){
this._y++;
if(this._y>400){
this.swapDepths(100)
this.removeMovieClip();
}}

the depth has to be above zero for removeMovieClip to work. Also I fixed your errors.


Goofy

zrb

Reply To Post Reply & Quote

Posted at: 6/24/08 04:08 PM

zrb LIGHT LEVEL 10

Sign-Up: 08/08/06

Posts: 3,851

yeah its possible

He said AS3. Besides your already on a bad start, AS3 doesn't let you put any AS on movie clips.

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

None

imCoOkie

Reply To Post Reply & Quote

Posted at: 6/24/08 04:11 PM

imCoOkie NEUTRAL LEVEL 01

Sign-Up: 06/24/08

Posts: 4

At 6/24/08 04:08 PM, zrb wrote:
yeah its possible
He said AS3. Besides your already on a bad start, AS3 doesn't let you put any AS on movie clips.

yeah but it allows you to put AS inside the movieclip.


None

Dizeaze

Reply To Post Reply & Quote

Posted at: 6/24/08 04:18 PM

Dizeaze DARK LEVEL 07

Sign-Up: 12/21/07

Posts: 416

inside = different.

YOU GOT RICK-ROLLED!

fuck


None

starBlinky

Reply To Post Reply & Quote

Posted at: 6/24/08 04:18 PM

starBlinky NEUTRAL LEVEL 06

Sign-Up: 09/24/04

Posts: 484

lol oh. well I still use AS1 on FlashMX.

Well replace the
onClipEvent(enterFrame)

with

onEnterFrame(){

}

I think that works, I can't remember if thats proper syntax. Try it though.


None

souled

Reply To Post Reply & Quote

Posted at: 6/24/08 04:26 PM

souled NEUTRAL LEVEL 14

Sign-Up: 09/18/06

Posts: 1,528

Well in AS2 you would use:

function onEnterFrame() {
	with (mc) {
		_y++;
		if (_y>400) {
			this.removeMovieClip();
		}
	}
}

with AS3 however.... I don't know. Though looking through AS3 Main I found

this.removeChild(something);

which may be sueful.


All times are Eastern Daylight Time (GMT -4) | Current Time: 01:50 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!