Forum Topic: AttachMovieClip Issue.

(125 views • 8 replies)

This topic is 1 page long.

<< < > >>
Expressionless

Hi5er

Reply To Post Reply & Quote

Posted at: 10/3/09 01:26 PM

Hi5er LIGHT LEVEL 08

Sign-Up: 05/14/07

Posts: 90

Right so in my game I have a spawner mc that spawns enemies using the AttachMovie code but when I leave the frame they are on they remain on the stage.

How do I make it so when I leave the current frame they diseappear?

Something to do with RemoveMovieclip();?

Thanks

I Will Stop posting When I Reach 100 Posts. Enjoy Me While You Can


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 10/3/09 01:35 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,383

Attach them within a movieclip that is removed when the frames change.

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


None

IWantSomeCookies

Reply To Post Reply & Quote

Posted at: 10/3/09 01:57 PM

IWantSomeCookies LIGHT LEVEL 13

Sign-Up: 08/20/04

Posts: 3,295

it's

removeMovieClip();

but remember it has to have a depth.. im sure it does cause your adding it to the stage via as :)

"Actually, the server timed out trying to remove all your posts..."
-TomFulp


None

Yambanshee

Reply To Post Reply & Quote

Posted at: 10/3/09 02:04 PM

Yambanshee DARK LEVEL 11

Sign-Up: 10/05/08

Posts: 1,585

At 10/3/09 01:57 PM, IWantSomeCookies wrote: but remember it has to have a depth.. im sure it does cause your adding it to the stage via as :)

when its being removed, the depth doesint mater. its just removeMovieClip(MCname)

AS2||AS3||Motox
Thanks to hdxmike for the sig :]

BBS Signature

None

IWantSomeCookies

Reply To Post Reply & Quote

Posted at: 10/3/09 02:07 PM

IWantSomeCookies LIGHT LEVEL 13

Sign-Up: 08/20/04

Posts: 3,295

At 10/3/09 02:04 PM, Yambanshee wrote:
At 10/3/09 01:57 PM, IWantSomeCookies wrote: but remember it has to have a depth.. im sure it does cause your adding it to the stage via as :)
when its being removed, the depth doesint mater. its just removeMovieClip(MCname)

doesn't the MC have to have a depth to be removed?

"Actually, the server timed out trying to remove all your posts..."
-TomFulp


None

El-Presidente

Reply To Post Reply & Quote

Posted at: 10/3/09 02:10 PM

El-Presidente LIGHT LEVEL 27

Sign-Up: 06/02/05

Posts: 5,193

At 10/3/09 02:07 PM, IWantSomeCookies wrote: doesn't the MC have to have a depth to be removed?

It's been so damn long since I've used Flash, my gosh! "attachMovie" automatically gives a legitimate depth I think, though.

MY E-PENIS IS BIGGER THAN YOURS
8=================================>
...and this is my fag...

BBS Signature

None

Yambanshee

Reply To Post Reply & Quote

Posted at: 10/3/09 02:15 PM

Yambanshee DARK LEVEL 11

Sign-Up: 10/05/08

Posts: 1,585

At 10/3/09 02:10 PM, El-Presidente wrote:
At 10/3/09 02:07 PM, IWantSomeCookies wrote: doesn't the MC have to have a depth to be removed?
It's been so damn long since I've used Flash, my gosh! "attachMovie" automatically gives a legitimate depth I think, though.

sortof
no

When you attach it (via actionscript) you MUST give it a depth. when removing it you dont need to mention the depth

AS2||AS3||Motox
Thanks to hdxmike for the sig :]

BBS Signature

Happy

milchreis

Reply To Post Reply & Quote

Posted at: 10/3/09 02:19 PM

milchreis DARK LEVEL 16

Sign-Up: 01/11/08

Posts: 436

every mc has the property "depth" so every mc has a "depth" ok?
even though the depth is 0, it still has a depth.
something that is transparent, has a color, but that color is transparent. It has a color, even thoug hyou can't see it, ok?

You cannot remove the mc if its depth value is smaller than 0. When you attach them dynamically it is a good idea to set their depth value to something positive (I'm not sure if it is poissible to set it to a negative number)

All MCs, Buttons that you create within the Flash IDE at authortime have a depth of below zero, that'S why you first have to swap their depths to something positive in order to being able to delete them.

"Even if it's just cynicism that remained to push us ahead, we'll carry on!"


None

Hi5er

Reply To Post Reply & Quote

Posted at: 10/3/09 03:43 PM

Hi5er LIGHT LEVEL 08

Sign-Up: 05/14/07

Posts: 90

At 10/3/09 02:19 PM, milchreis wrote: every mc has the property "depth" so every mc has a "depth" ok?
even though the depth is 0, it still has a depth.
something that is transparent, has a color, but that color is transparent. It has a color, even thoug hyou can't see it, ok?

You cannot remove the mc if its depth value is smaller than 0. When you attach them dynamically it is a good idea to set their depth value to something positive (I'm not sure if it is poissible to set it to a negative number)

All MCs, Buttons that you create within the Flash IDE at authortime have a depth of below zero, that'S why you first have to swap their depths to something positive in order to being able to delete them.

yes but you cant attach multiple mcs that are the same with the same depth. Therefore you have to change their depth via Action script in order to get the same mc to 'spawn' :)

ima go ahead and try removeMovieClip(mymc); havent tried that been trying all sorts of crazy things with depth ^_^

Thanks all

I Will Stop posting When I Reach 100 Posts. Enjoy Me While You Can


All times are Eastern Standard Time (GMT -5) | Current Time: 05:53 AM

<< 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!