View Full Version : Removing MovieClip Help!!
Edwina
January 7th, 2008, 01:47 AM
Hello people, i need help on one section. Removing my movieclip. My FLA is available for download below.
Download Fla Here (http://www.geocities.com/helloiamedwina/HawkerCentreStageOne.fla)
How do i make the dish disappear when the customer has finished eating? I tried putting in the removeMovieClip codes but it don't work.
Do i have to add something else?
Under my first character movieclip, frame 11, my codes are as follows. I don't know if i should add it here, because when i do, it doesn't work.
howManyTimes+=1;
if (howManyTimes>=5) {
trace("I'm full!");
//The dish has been consumed, can be cleared
//TODO: Clear back its' contents and move it back to counter
if (satayOrder){
_root.dish.busy = false;
} else if (chickenOrder){
_root.ChixDish.busy = false;
} else if (toastOrder){
_root.toastDish.busy = false;
}
_root.dish.busy = false;
_root.ChixDish.busy = false;
_root.toastDish.busy = false;
_root.score += 1;
_root.score_txt.text = _root.score;
gotoAndStop(1);
} else {gotoAndPlay(2);}Is this where i should add? Kindly download the fla and help me! :D Or advise me on the right codes and right section i can add, thanks!
ArmoredSandwich
January 7th, 2008, 08:41 AM
_root.dish.removeMovieClip();
or
removeMovieClip(_root.dish);
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary631.html
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary564.html
depends on how u created the movieclip. Ur code is a freaking mess, so i didnt really looked into it.
fatrabbit
January 7th, 2008, 02:24 PM
What if the Movieclip is physically on the stage, and is animated along a path, can it be removed?
In the attached example, the nuke follows the motion path, but I can't put in removeMovieClip(); to delete it once it hits the city - any ideas?
Mr beef
January 7th, 2008, 02:43 PM
I think you can only remove attached movieClips, not ones allready placed on the stage. Not 100% sure but i'm sure I was told that.
ArmoredSandwich
January 7th, 2008, 02:51 PM
I think you can only remove attached movieClips, not ones allready placed on the stage. Not 100% sure but i'm sure I was told that.
See the two links I put, apparently you cannot delete the movieclips already on stage. But then again, you shouldnt put anything that you use in your game on stage.
fatrabbit
January 7th, 2008, 02:53 PM
How would you attach a Moveclip to a motion path?
Mr beef
January 7th, 2008, 03:05 PM
make a movieclip of the movieclip doing the motion path? And why shouldn't you have anything on the stage?
ArmoredSandwich
January 7th, 2008, 03:05 PM
How would you attach a Moveclip to a motion path?
There is a way, but i never did it. I believe i read something about it in a book but Im not sure.
You could also use some kind of waypoint system. I can imagine that there are multiple missiles being launched towards the Seattle, am I right? If that is really the case you could just reset its position and you'd be done.
For the waypoint system I would use some kind of array with locations. If it reaches one it goes towards the next one.
Better would be to not have a pre programmed path but rather let the missles next position be calculated with "gravity", velocity and angle.
You could also just attach a movie with the missiles movieclip animated in it. Lol, I bet that would be the easiest way xD
hey, im just brain storming here. So much posibilities. Anyhow, nice topic hijacking xD s0z Edwina :P
edit: oh beef posted more while I was typing this response. And guess what, he already thought of the same thing lol xD (I always start thinking about too dificult things when its actually very easy).
You shouldnt have anything on stage because of problems such as this. Besides that nothing on stage is much more dynamical. You can change everything with just some short pieces of code. There are even more reason, but i gotta eat some pie right now (yea, its hard task, but someones gotta do it right?).
Mr beef
January 7th, 2008, 03:12 PM
Hehe, ok. I was just wondering if I had done something seriously wrong. I have a few things that never change , they just stay there as detail because they'll allways be needed, so it doesnt really matter if it's static. My enemies,spells and dropped items are attached because I needed more control over them as they would allways be deleted at some point.
Edwina
January 7th, 2008, 03:31 PM
uh oh, that means i gotta re do the whole thing? but i cant.. the deadline is this weekend, haha! i'm dead meat.. is there any way i can make the whole dish disappear after the char has finished eating? =/
Mr beef
January 7th, 2008, 03:34 PM
What do you mean by dissappear? Things do just dissappear in flash, except my working code...:/
fatrabbit
January 7th, 2008, 03:53 PM
Sorry for hijacking this thread a bit - hey, it was still relevant to the OP.
That's a great idea about making a movieclip of the motion, but how would you detect if the nuke had hit the city?
fatrabbit
January 7th, 2008, 04:27 PM
Sorry for hijacking this thread a bit - hey, it was still relevant to the OP.
That's a great idea about making a movieclip of the motion, but how would you detect if the nuke had hit the city?
Nevermind, it works from the attached example.
However, the MC is still physically on the stage - how do I spawn it using actionscript and remove when the hiTest is true?
ArmoredSandwich
January 7th, 2008, 04:56 PM
uh oh, that means i gotta re do the whole thing? but i cant.. the deadline is this weekend, haha! i'm dead meat.. is there any way i can make the whole dish disappear after the char has finished eating? =/
everythings possible... well except removing movieclips haha xD.
You could either change the property of a movieclip _visible to false or just move it somewhere away out of sight. GL.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.