USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 10/5/09 08:42 AM
Sign-Up: 10/05/09
Posts: 5
Does anyone know how to remove movieclips in AS2? Help Here is my code so far:
on enterFrame = function (){ if (root.Player2.hitTest(root.Coin3)){ Coin_3.removeMovieClip(); score += 1; }
Note: Player_2 and Coin_3 are both instance names. The code is also assigned to the frame, not the clips.
Savagehare99
Posted at: 10/5/09 09:21 AM
Sign-Up: 10/05/08
Posts: 1,607
two things, 1, how did you add them, through action script or by dragging them onto the frame? 2, why is your function like that, shouldent it be onEnterFrame = function?
AS2||AS3||Motox Thanks to hdxmike for the sig :]
Posted at: 10/5/09 10:39 AM
Sign-Up: 09/11/09
Posts: 1,831
At 10/5/09 09:21 AM, Yambanshee wrote: two things, 1, how did you add them, through action script or by dragging them onto the frame? 2, why is your function like that, shouldent it be onEnterFrame = function?
Ditto. Also if you dragged them into scene ( if they were there when the movie started ) you cant get rid of them otherwise Coin_3.removeMovieClip(Coin_3) or what you did cant remember If you want to get rid of them make sure there not there and use attachmovieclip fuction K
Or have an off screen Mc to duplicate but i wouldnt suggest that
also . Use AS3 and make a classes, its better
OOP AS3 || Flash 8,CS3,CS4 || *sigh* || The new forum on the block : FLASH SEED !
Posted at: 10/5/09 10:42 AM
Sign-Up: 08/10/05
Posts: 6,027
At 10/5/09 10:39 AM, hdxmike wrote: Also if you dragged them into scene ( if they were there when the movie started ) you cant get rid of them otherwise Coin_3.removeMovieClip(Coin_3) or what you did cant remember
Yes you can. You just have to give it a positive depth (using swapDepths()) before removing if you didn't add the MC via code as it will by default have a negative depth. His function was right. If you do Coin_3.removeMovieclip(Coin_3) then you're looking inside Coin_3 for an mc called Coin_3 which isn't right.
Portfolio(Under construction): UnknownFury.com | Msn: giant_ak_47@msn.com | Contact: me@unknownfury.com Follow me on twitter!
Posted at: 10/5/09 10:50 AM
My mistake, i said i couldnt remember Any way thats right just give it a positive depth
Posted at: 10/5/09 12:47 PM
so... any code anyone could give me?
Posted at: 10/5/09 12:54 PM
At 10/5/09 12:47 PM, savagehare99 wrote: so... any code anyone could give me?
you haven't told us how you added it...
Posted at: 10/6/09 03:12 PM
I dragged them onto the stage.
Posted at: 10/13/09 02:24 PM
never mind, figured it out now
All times are Eastern Standard Time (GMT -5) | Current Time: 01:22 AM
<< Back